Using AI to reverse engineer a design?
I asked chatgpt if it could reverse engineer a design and it said with good photos and part values it could produce a schematic. Has anyone tried this?
- aion
- Resistor Ronker
Information
I originally posted a response that was dismissive and snarky. I apologize. But as someone who has been tracing for a long time, and who knows both how complex tracing is and what AI is good for, it's important to understand that in the current state of AI, this is completely bananas. Please do not ever post an AI-assisted trace to FSB.
Most people have a very simplistic idea of how ChatGPT and generative AI work. There are certain tasks that they do shockingly well, and this tricks people into thinking that it must be smarter than it actually is.
But at their core, LLMs and GenAI are optimized to tell you what you expect to hear. You asked ChatGPT if it could reverse-engineer a circuit. It believes it can respond to your request, and it will in fact give you what it thinks is what you want if you provide the inputs it asks for. But it does not actually know what any of that means, and the circuit will not function even remotely because the AI is not doing the work behind the scenes to verify that it's a reasonable circuit.
This is not because it's technologically impossible for AI. It's because it takes an enormous amount of work on the part of the AI creators on the backend in order to make the AI good at a given task - e.g. writing song lyrics in a certain style, or basic coding (where the AI has the advantage of being able to actually run the code on its own to verify that it works). And OpenAI and others have absolutely not spent the time and money to help their LLM understand antiquated analog technology for the inner workings of guitar pedals, because the people who might use this technology would number in the thousands, if not the hundreds.
So, let's say you ask ChatGPT to trace a circuit and provide the inputs. If it gets one single component wrong, or one connection, then the circuit doesn't work. You will waste so much time verifying it that by the time it's 100% accurate, you'll have spent more time helping ChatGPT generate a correct schematic than you would have spent just making it from scratch. And ChatGPT isn't going to be smarter as a result of the process—but you could have been, if you spent that time putting in the effort.
Human errors also have the advantage of intention, so our errors are often at least recognizable and the correct answer isn't far off. I know that it's easy for a person to misread a resistor color band as brown when it should be red, so if I'm reviewing someone else's work, I'm on the lookout for decade errors in component values. But AI reasoning is completely foreign to us, and it's capable of technical errors that we would have a hard time spotting because a human would never make those particular mistakes.
Most people have a very simplistic idea of how ChatGPT and generative AI work. There are certain tasks that they do shockingly well, and this tricks people into thinking that it must be smarter than it actually is.
But at their core, LLMs and GenAI are optimized to tell you what you expect to hear. You asked ChatGPT if it could reverse-engineer a circuit. It believes it can respond to your request, and it will in fact give you what it thinks is what you want if you provide the inputs it asks for. But it does not actually know what any of that means, and the circuit will not function even remotely because the AI is not doing the work behind the scenes to verify that it's a reasonable circuit.
This is not because it's technologically impossible for AI. It's because it takes an enormous amount of work on the part of the AI creators on the backend in order to make the AI good at a given task - e.g. writing song lyrics in a certain style, or basic coding (where the AI has the advantage of being able to actually run the code on its own to verify that it works). And OpenAI and others have absolutely not spent the time and money to help their LLM understand antiquated analog technology for the inner workings of guitar pedals, because the people who might use this technology would number in the thousands, if not the hundreds.
So, let's say you ask ChatGPT to trace a circuit and provide the inputs. If it gets one single component wrong, or one connection, then the circuit doesn't work. You will waste so much time verifying it that by the time it's 100% accurate, you'll have spent more time helping ChatGPT generate a correct schematic than you would have spent just making it from scratch. And ChatGPT isn't going to be smarter as a result of the process—but you could have been, if you spent that time putting in the effort.
Human errors also have the advantage of intention, so our errors are often at least recognizable and the correct answer isn't far off. I know that it's easy for a person to misread a resistor color band as brown when it should be red, so if I'm reviewing someone else's work, I'm on the lookout for decade errors in component values. But AI reasoning is completely foreign to us, and it's capable of technical errors that we would have a hard time spotting because a human would never make those particular mistakes.
Not sure I agree. I think the adage garbage in equals garbage out applies in this case. You would need really clear photos and all part numbers. Also you would be limited to a 2 layer board since all inputs would be photos. I do agree in the case of writing code. In that case you still need to understand what the AI has written especially if there are bugs. Maybe the same applies here. I think there is a level of complexity that is involved. It may work on simple designs but fail on more complicated designs. I think where it could excel would be in determining trace routing. For me, this is the hardest part of reverse engineering. AI is being used for autorouting. See Flux.ai.
- aion
- Resistor Ronker
Information
We don't have to agree, you can just try it and see what happens. Do a simple circuit with a known schematic, some pedal that's already been traced here and has good photos of the components and traces. Preferably a single-sided PCB to make it even simpler.
Just make sure anything you post is clearly labeled as AI-generated or assisted. AI info pollution is going to be an enormous problem over the coming years and the internet is in no way prepared to deal with it. The longer we can keep it away from this community the better.
Just make sure anything you post is clearly labeled as AI-generated or assisted. AI info pollution is going to be an enormous problem over the coming years and the internet is in no way prepared to deal with it. The longer we can keep it away from this community the better.
- mozz
- Breadboard Brother
They do make a machine, sort of cross between a microscope and a x-ray machine, we have one at work. You can look at the top layer, then focus down to another layer to see the traces. Then adjust even lower to look at the next layer or to the bottom layer. We have used it to build circuit boards that the original manufacturer would not supply anymore. Once all obsolete parts were acquired they were populated and it worked. I don't know if it generated the Gerber files or was done in AutoCAD. I didn't work directly with that machine but was shown what it does.
- george giblet
- Cap Cooler
Anyone who has traced from photos knows that photos never capture all the info. (If you are tracing you can go back and ask for those photos and add them to the set but that's a luxury we don't often have.)
Sometimes you have to know what should be there in order to join the dots. It's like putting a jigsaw puzzle together where the mice have eaten all the edges off. That's where experience pays off. At the opposite end of the scale are people who trace and draw schematics which will cannot be correct, even from basic electronics perspective. It's a flag that you have made a mistake.
- Jarno
- Resistor Ronker
Information
- Posts: 412
- Joined: 12 Nov 2008, 10:18
- my favorite amplifier: Something nice
- Completed builds: Alembic-like state-variable and sallen-key filter preamps
Lovepedal Eternity
Phase 100
Brown source
Fuzz Face
Flipster
Alembic F2B (tube preamp)
Opamp and FET buffers
Loads of speakercabinets and ampracks
Busy building a modular synth (ssm2044 vcfs, preamps, ADSR's, VCO's, VCA's)
Tables
Bookshelves
Basses
So many things! :D - Location: Rosmalen, NL
- Has thanked: 34 times
- Been thanked: 87 times
Also not a believer in AI here, I think it might work if you do not particularly care about the solution just that it sort of works, and have heaps of data to throw at it. I think in general, in engineering, we deeply care about how requirements are translated in a solution. AI might help one see patterns and relations in mountains of data, but you'd still want to understand cause and effect, or else the model might start to create very wrong outcomes.
My wife sometimes uses chatGPT to quickly make a piece of communication, and while often overly "wordy", it works for that, non critical, needs to be friendly and get the message across, that's it. In a lot of cases, I guess it works for that.
My wife sometimes uses chatGPT to quickly make a piece of communication, and while often overly "wordy", it works for that, non critical, needs to be friendly and get the message across, that's it. In a lot of cases, I guess it works for that.
"It crackles....., but that's ok"
- Dirk_Hendrik
- Old Solderhand
Information
It's pretty much what you use it for. For the application of an automated reverse engineering process of an analog circuit?The checking and validation will take more time than doing the thing yourself. For reverse engineering large digital circuits, provided all data like PCB layouts and parttypes is known? That could be done for sure. Question is why you would like to do it.
But then,
Above the flux.ai is presented. What I see there is definitely not up to speed with anything.... yet. What the old autorouters lacked in such an extend that they are stil frowned upon was a form of "intuiitive" functioning. And that is exactly where AI comes in. These flux guys results mas seem pathetic now but I wonder what their output will be 5 years from now.
A few weeks ago I was at the Embedded World in Nuremberg, Germany where I as pulled into a boot by 2 guys who "had to show me something". What they had made is an application which, based on a block diagram and some low level requirements spits out a circuit diagram (Altium for sure, most likely other formats as well). BOM (simple) fully calculated power tree (takes me a few days), max alowed circuit tolerances (takes me a few days to collect/calculate too) Now I could play the smartass and decide to look for all things in that circuit that "could be done better" but let's face it, when I design a circuit based on a block diagram that usually takes me days to weeks. Without all the other deliverables that are generated in parallel. And if the output is already that good, expect this types of applications to be common in a few years.
Back to those PCB layouts. What makes a layout great? Over the last few years the challenge in all my (and my direct colleagues) layouts is called "pass certification testing" and therefore doing layouts that met EMC requirements. Can AI do that? I have been working with a company (Denpaflux) for a year now who do full EMC design analysis. Partially by EMC specialists but loads of AI assisted stuff as well that very easily picks out loads of small items that can be improved. Depending on your subscription they charge hundreds to a few thousand a year but what they deliver will costs more if I have to spend countless hours doing that EMC review work, hunting for possible improvements.
In short, AI is here. For some things we may not like it but it is here to stay. My suggestion is to embrace it.
But then,
Above the flux.ai is presented. What I see there is definitely not up to speed with anything.... yet. What the old autorouters lacked in such an extend that they are stil frowned upon was a form of "intuiitive" functioning. And that is exactly where AI comes in. These flux guys results mas seem pathetic now but I wonder what their output will be 5 years from now.
A few weeks ago I was at the Embedded World in Nuremberg, Germany where I as pulled into a boot by 2 guys who "had to show me something". What they had made is an application which, based on a block diagram and some low level requirements spits out a circuit diagram (Altium for sure, most likely other formats as well). BOM (simple) fully calculated power tree (takes me a few days), max alowed circuit tolerances (takes me a few days to collect/calculate too) Now I could play the smartass and decide to look for all things in that circuit that "could be done better" but let's face it, when I design a circuit based on a block diagram that usually takes me days to weeks. Without all the other deliverables that are generated in parallel. And if the output is already that good, expect this types of applications to be common in a few years.
Back to those PCB layouts. What makes a layout great? Over the last few years the challenge in all my (and my direct colleagues) layouts is called "pass certification testing" and therefore doing layouts that met EMC requirements. Can AI do that? I have been working with a company (Denpaflux) for a year now who do full EMC design analysis. Partially by EMC specialists but loads of AI assisted stuff as well that very easily picks out loads of small items that can be improved. Depending on your subscription they charge hundreds to a few thousand a year but what they deliver will costs more if I have to spend countless hours doing that EMC review work, hunting for possible improvements.
In short, AI is here. For some things we may not like it but it is here to stay. My suggestion is to embrace it.
- Manfred
- Tube Twister
Information
- Posts: 2074
- Joined: 04 Apr 2009, 23:42
- Has thanked: 1758 times
- Been thanked: 1455 times
To find the circuit diagram from photos of the component side and solder side, I follow the steps below.
First, I crop the images using IRFAN, so that the corners of the PCB touching the frames.
Then I use GIMP and bring the image into the rectangle using the Tool->Transformation-> perspective and export it into a graphic format.
Now I load the images as a template into the SprintLayout6.0 software and save the project.
Next, I determine the dimensions of the PCB using a reference component, e.g. an OpAmp.
Now I change the size of the graphic files of the templates to the found size using IRFAN and load them again as a template for SprintLayout 6.0.
So I can create the PCB clone using the templates.
At least I using the tracing function of SprintLayout 6.0 to find the schematic.
I do not know if the AI can do this.
First, I crop the images using IRFAN, so that the corners of the PCB touching the frames.
Then I use GIMP and bring the image into the rectangle using the Tool->Transformation-> perspective and export it into a graphic format.
Now I load the images as a template into the SprintLayout6.0 software and save the project.
Next, I determine the dimensions of the PCB using a reference component, e.g. an OpAmp.
Now I change the size of the graphic files of the templates to the found size using IRFAN and load them again as a template for SprintLayout 6.0.
So I can create the PCB clone using the templates.
At least I using the tracing function of SprintLayout 6.0 to find the schematic.
I do not know if the AI can do this.