PCB Component Defect Identification. Can you identify defect components on a PCB Board using Machine Learning/Deep Learning?
There is a PCB Manufacturer, who wants to automatically detects on their PCBs. Components are laid out and there could be two types of defects. All the PCBs are supposed to look identical (with some tolerance for error in placement)
- Missing Components - No component should be missing
- Rotated Components - No component should be oriented incorrectly
Here is what a correct PCB looks like:
You can download dataset from this link Dataset
DLAssignment
├── 1.1.jpg
├── 1.1.xml
├── 1.jpg
├── 1.xml
├── ...
├── ...
├── errors
│ ├── 1.1.jpg
│ ├── 2.2.jpg
│ ├── .....
├── number_to_component.json
Each image (.jpg file) has a corresponding annotation (.xml) file which has locations of each of the components marked on it.
For each image that has a defect on it, there is a image with the same name in the errors folder. The images in the errors folder, have the errors drawn on the image in red.
If a PCB has all of the components on it then it's corresponding XML file will have 60 bounding boxes drawn on it. These XML files are in VOC pascal format. If a component is missing no annotation would be found in it's place. If the component is rotated, then the field rotated would be marked as <rotated>1</rotated>
Sample annotation of a single component:
<annotation>
<folder>ImageSets</folder>
<filename>1.1.jpg</filename>
<path>/1.1.jpg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>3840</width>
<height>2748</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<!--Lots of other objects here.....-->
<object>
<name>1_a</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<rotated>0</rotated>
<bndbox>
<xmin>771</xmin>
<ymin>377</ymin>
<xmax>1366</xmax>
<ymax>569</ymax>
</bndbox>
</object>
<!--Lots of other objects here.....-->
</annotation>
There are a total of 60 unique components. There might be components of the same type. A component would be labelled 1_a
or 57_af
, 57
here would represent the unique component number, af
would represent the component type. Example both 59_o
and 60_o
are of the same type, but have different positions on the PCB. This might be helpful.
The file number_to_component.json
contains the mapping between the numbers and the types.
Write a python function that works in the following way:
python process.py path_to_image
Component 13 Rotated
Component 22 Missing
Component 31 Missing
No Errors
- You need to implement deep learning/machine learning based models to solve this problem (you can use 1, or many).
- Identify components that are missing
- Identify components that are rotated
- The script should accept an image path as an input and print the output in the specified format
- Use any code, model, technology, library you want.
- Bonus if your algorithm is extensible to other PCB designs as well, which can be trained given adequate training data in the same format and no other human intervention
- A working script which accepts an image as an input and prints the output as specified. Along with instructions to use and setup.
- A github repo with model training code and code for any preprocessing, data analysis. Even jupyter notebook should work. We don't need to be able to run this code, just see the method followed.
- Accuracy/Other metrics of the model/s
- A short write up of the approach you used (this could be a doc, a readme, or inline code comments or comments in a jupyter notebook)
- Split the data for training and validation however you like
- We have a seperate test set that we will use for testing your code
- Finishing the assignment - Detecting missing components (25%)
- Finishing the assignment - Detecting rotated components (25%)
- Approach (25%)
- Code quality (15%)
- Accuracy (10%)
- Bonus (25% extra)