{"id":95913,"date":"2023-02-22T08:47:51","date_gmt":"2023-02-22T00:47:51","guid":{"rendered":"https:\/\/www.tm-robot.com\/docs\/tm-aiclassification-application-example-ipc-inspection\/"},"modified":"2023-07-12T15:54:26","modified_gmt":"2023-07-12T07:54:26","slug":"tm-aiclassification-application-example-ipc-inspection","status":"publish","type":"docs","link":"https:\/\/www.tm-robot.com.cn\/de\/docs\/tm-aiclassification-application-example-ipc-inspection\/","title":{"rendered":"TM AI+Classification application example – IPC inspection"},"content":{"rendered":"
The example of this article applies to the following conditions :<\/p>\n
Hardware requirements :<\/p>\n
Software requirements :<\/p>\n
Version requirements:<\/p>\n
Use the display panel of the IPC for Pattern matching positioning, and move the robot to the inspection area to inspect the following items in order<\/p>\n
1.Is the filter ring installed on the power line<\/p>\n
2.Whether the cable is actually inserted into the slot<\/p>\n
3.Are the screw holes screws<\/p>\n
4.Is the cable alignment method correct<\/p>\n
Determine the working enviroment is fixed, the IPC placed on the work plane, adjust the shooting angle, and open the light source, you can replace the polarizer to avoid reflections that lead to unclear images.<\/p>\n
Move the robot to the desired location, use the controller to control the movement of the robot, and observe whether the object to be detected is within the visible range through Vision.<\/p>\n Determine the field of view to be detected, place a TM calibration plate, open the light source (it is recommended that the use of polarizers to avoid reflections leading to unclear shooting), adjust the parameters of the camera.<\/p>\n When performing AI Classification, the entire screen is not captured, but the features within the detection range must be selected.\u00a0 The following examples show how to select ROI and choose the images to be captured for the following detection contents.<\/p>\n Attach the filter ring first. Because the filter ring is attached to the power line, there will be a certain range of movement. When making a frame selection for the filter ring, the possibility of moving the filter ring must be considered as much as possible. Refer to the following figure<\/p>\n When collecting OK situations, various possibilities of the movement of the filter ring must be considered, so you can try to move the filter ring more to create various possibilities of the appearance of the filter ring . To ensure that there is enough information, it is recommended to collect about 30 images. The demonstration is as follows.<\/p>\n When collecting NG situations, various possibilities of the power cord must be considered, so you can try to create various possibilities of the power cord. In order to ensure enough information, it is recommended to collect about 30 images, as shown below.<\/p>\n Since the position of the plug-in is fixed, the plug-in screen must occupy most of the ROI screen, so as to avoid being affected by the background factors and affecting the AI judgment.<\/p>\n When collecting OK situations, since the plug-in changes little, you can try to change the angle of the wire head. It is recommended to collect about 30 images, or change the ambient light source to adapt to various environmental changes. If you want to change the ambient light source, it is recommended to collect more images to increase the information for AI learning. When collecting NG cases, you need to collect more possibilities of incomplete insertion, to prevent AI from confusing the cases that are almost inserted and fully inserted. At the same time, you also need to consider the possibility of no insertion at all. It is recommended to collect about 30 images.<\/p>\n When selecting the screw hole, the hole position must also occupy more than half of the ROI. Considering that there are various angles or lighting problems when shooting screws, the selection range should not be too narrow, so that it can cope with different situations.<\/p>\n Since the state of the screw locking the screw does not change much, and the background is mostly metal surface, we can create additional light sources to increase the information of various environmental changes.<\/p>\n The following shows the situation of collecting OK images. It is recommended to collect about 30 images. You can see that each image is affected by different light and shadow.<\/p>\n Whwn collecting NG images, you can also refer to the way of collecting OK images. It is also recommended to collect about 30 images and consider the influence of different light soutces.<\/p>\n After taking the upper screw, we move the robot to the side of the IPC and check whether the side screws are locked. Since there are various changes in the side shot, you can also create extra light sources to simulate different situations.<\/p>\n The screw hole should also occupy more than half of the ROI range, and the screw hole should be as close to the center of the ROI as possible, to prevent reflection from causing AI information misjudgment.<\/p>\n Similarly, when collectng OK situations, you can consider different light sources. In order to make AI able to judge more screw, you can add the situation of shooting the upper control box to this situation for training. It is recommended to collect about 30 images, combined with the situation of the upper control box, to cope with various situations.<\/p>\n And when collecting NG situations, you can also add the situation of shooting the upper control box to this situation for training. It is recommended to collect about 30 images, combined with the situation of the upper control box, to cope with various situations.<\/p>\n The purpose of this task is to confirm whether the cable is properly\u00a0 inserted and inserted in the correct position, and therer should be no wrong or unplugged situations. The entire cable should also occupy most of the ROI range, and try not to have redundant backgrounds that affect AI judgment. We divide the cable into three situations for image collection.<\/p>\n Image collection instructions – whether the cable is connected correctly_OK situation<\/b><\/p>\n One-to-one correspondence, overlapping lines are also accepted, make sure the cable head is properly inserted, create some opening and closing situations, and create overlapping cable heads, collect about 30 images, the following are all regarded as OK situations.<\/p>\n Image collection instructions – whether the cable is connected correctly_CROSS situation<\/b><\/p>\n The cable head is properly inserted, but inserted in the wrong hole, collect the situations of two lines crossing, three line crossing, and four lines crossing, and consider all possible combinations as much as possible. Collect 2 to 3 images for each of the above situations, so a total of about 30 images are collected. Image collection instructions – whether the cable is connected correctly_NG situation<\/b><\/p>\n The cable head is not properly inserted, collect the situations where there may be four unplugged, three unplugged, two unplugged, or even all unplugged, collect about 30 images.<\/p>\n There are two main items for storing images (for detailed storage instructions, please refer to the manual)<\/p>\n When\u00a0 choosing the\u00a0 second\u00a0 way\u00a0 to\u00a0 store\u00a0 Source\u00a0 images,\u00a0 you can\u00a0 Crop\u00a0 ROI\u00a0 in\u00a0 the\u00a0 Dataset\u00a0 of\u00a0 version 2.12 Training\u00a0 Server Open source image Crop ROI.\u00a0 The\u00a0 ROI will be labeled as unlabeled after the crop.<\/p>\n Save the images of the inspection processes above into two datasets, one for OK and another for NG, as shown below.<\/p>\n TM AI+ is built on the company’s internal server. Any device that can connect to the company’s intranet can use TM AI+ through a browser, and there is no restriction on the system for operation. This article uses TM AI+ Training Server 2.12.2200 as an example.<\/p>\n This is the manegerment screen of the Dataset, where we can import our datasets. Create a classification dataset.<\/p>\n Click Edit to create a dataset.<\/p>\n Create labels and upload the corresponding datasets.<\/p>\n This is the project management screen, where you can create our projects.<\/p>\n Add a project, name it and select Classification.<\/p>\n Choose the appropriate model and dataset according to the task scenario.<\/p>\n After adjusting the parameters, start training the model.<\/p>\n After the training is completed, you can use summary to check the performance of the trained model, and use Heatmap to analyze whether the information learned by AI is the feature we want to compare. Then this article will analyze each detection result and perform analysis.<\/p>\n Observing the training progress, the accuracy of each training session is almost 100 percent, indicating that the model for detecting the filter ring is more stable.<\/p>\n By using the heatmap, we can see that AI has detected the filter ring on the line, indicating that features learned by AI are reasonable. We import this model into the robot for testing, and it can stably distinguish whether there are filter ring.<\/p>\n Then we switch to another robot and environment for testing and it can also stably distinguish, without changing the model.<\/p>\n Observing the training progress, the accuracy of multiple training sessions is 100 percent, indicating that the model for detecting whether the plug is properly inserted is more stable.<\/p>\n By using the heatmap, we found that the features learned by AI focused on the small black hole at the top. If it is not properly inserted, the black hole at the top will be particularly obvious and will be judged as NG. The result is as we expected. The heatmap of the NG situation also pays attention to whether the black hole at the top is too obvious, or whether the plug is completely detached. After importing the model into the robot, it can also run smoothly in various situation.<\/p>\n Then we switched to another robot and environment for testing, and found that the situation of complete detachment was easily judged as OK. We guessed that the change of light source caused the wiring to be unclear, and mistakenly judged the situatin of the wire head lying flat on the top of socket. So in this environment, we added about 20 more NG situations, and also added about 20 more OK situations to adapt to the environmental changes.<\/p>\n Observing the training progress, the accuracy of the training session is mostly 100 percent, indicating that the model for detecting whether there are screws in the screw holes under the condition of shooting the IPC from above is stable.<\/p>\n By using the heatmap, we can see that AI can learn the feature of whether there are screws on the holes under any light source. After importing the model into the robot, the test is also very stable.<\/p>\n Then we switched to another robot and environment for testing, and it can also stably distinguish, without changing the model.<\/p>\n Observing the training progress, the accuracy of the training sessions is also mostly 100 percent, indicating that the model for detecting whether there are screws in the screw holes under the condition of shooting the IPC from the side is also stable.<\/p>\n Using the above-mentioned image acquisition method for the first training, the training progress is less stable than the previous situations.<\/p>\n Observing the heatmap, we cannot determine whether the situations of OK overlapping and CROSS have been learned by AI. We need to import the robot for actual testing.<\/p>\n 1.After importing the robot testing, we can find that the two crossed lines under CROSS are easy to judge as OK, while the three and four crossed lines have no problem.<\/p>\n 2.And under the NG situation, the lines that are not inserted side by side are also easy to be judge as NG.<\/p>\n 3.Under the OK situation, if there is overlapping, it is also easy to judge as CROSS.<\/p>\n After collecting about 20 images of the misjudged situations and retraining, the problem still could not be improved, and even failed to converge to a more correct result.<\/p>\n So we changed the model selection from Regular to Ultra for training, performed data augmentation, and some minor parameter adjustments, to make it consider more variations.<\/p>\n 1.Epochs increased from 30 to 100, giving it a chance to find a convergent result.<\/p>\n 2.Batch Size is set smaller, so that it will not see too many possibilities at the same time, and cause it to fail to converge.<\/p>\n 3.Learning Rate is slightly adjusted lower, so that it has more chance to reach a lower Loss.<\/p>\n After the adjustment, the training progress has found a lower Loss, and some 100 percent Accuracy has appeared, but it is still not certain that the trained model is reasonable. Then import this model into the robot test, which improved the following issues<\/p>\n In OK situations, if there are overlapping issue, they still cannot be recognized.<\/p>\n It is recommended to treat OK situations with overlapping issues as CROSS, they still need to be adjusted by inspection personnel.<\/p>\n Therefore, the problem is reclassified as follows:<\/p>\n After readjusting the classification, perform model training and observe the heatmap, and find that AI can correctly learn the nodes caused by the crossing of wires and the holes exposed by not inserting correctly.<\/p>\n Finally, import the robot and change the environment for testing, and it can run stably.<\/p>\n
<\/a><\/p>\n
\nMove the robot to select the shooting area<\/strong><\/h3>\n
<\/a><\/p>\n
\nShooting images and parameter adjustment<\/b><\/h3>\n
<\/a><\/p>\n
\nHow to select the ROI and image collection\u00a0<\/strong><\/h2>\n
Image collection instructions<\/h3>\n
\n
\n
\n
\n
\n
\nImage collection instructions\u00a0– Is equipped with filter ring<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nImage collection instructions\u00a0-Is the plugin actually inserted<\/strong><\/h3>\n
<\/a><\/p>\n
\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nImage collection instructions-whether there is a screw in the screw hole_top shot of the IPC<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nImage collection instructions – whether there is a screw in the screw hole_side shot of the IPC<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nImage collection instructions – whether the cable is connected correctly\u00a0<\/b><\/h3>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nImage collection instructions – image storage method<\/strong><\/h3>\n
\n
\n
\n
\n
\n
<\/a><\/p>\n
\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nTrain models with TM AI+ and import AI models into robot testing<\/strong><\/h2>\n
TM AI+ operation<\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nTM AI+ – Is equipped with filter ring<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nTM AI+ – Is the plugin actually inserted<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nTM AI+ – whether there is a screw in the screw hole_top shot of the IPC<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nTM AI+ – whether there is a screw in the screw hole_side shot of the IPC<\/strong><\/h3>\n
<\/a><\/p>\n
\n\n
\nTM AI+ – whether the cable is connected correctly<\/strong><\/h3>\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
\n
<\/a><\/p>\n
\n\n
\n
\n