An Autonomous System Design For Mold Loading On Press Brake Machines Using A Camera Platform, Deep Learning, and Image Processing
An Autonomous System Design For Mold Loading On Press Brake Machines Using A Camera Platform, Deep Learning, and Image Processing
1007/s12206-023-0740-y
† Recommended by Editor
Hyung Wook Park
1. Introduction
Press brakes are CNC-controlled metal bending machines often used in industrial applica-
tions such as the production of automotive panels, aircraft fuselage, furniture, and others.
Sheet metals are produced as flat shapes and can be transformed by press brake machines
into preferred shapes in a short time. The weight of press brakes vary in the range of 30-20000
tons and the width in the range of 1000-8000 mm. Two types of molds are used in the bending
process: upper and lower. The upper and lower molds have the same “V” shape to allow the
upper mold to enter the lower mold. This design bends the sheet between the molds with high
hydraulic power according to the production schedule [1-4]. Molds used in metal sheet bending
have varying sizes, dimensions, and numbers. An operator places these molds in the machine
according to conventional methods. Then, the operator places the sheet metal, which is bent,
between the molds and implements the desired process using hydraulic power.
With the development of robotic technology in recent years, industrial robotic arms have been
used to feed press brakes. Integrating industrial robotic arms into press brake machines in-
creases production flexibility and speed. Thus, the machines are transformed into successful
robotic automation applications with reduced cycle time and higher quality [5-8]. Worldwide
manufacturers are developing robotic arm-fed press brake machines. The feeding system in-
cludes placing molds and sheet metals into machines according to software. Studies on press
brake machines and robotic systems are based on the loading and unloading of sheets and
bending of the sheet metal with robotic arms [5-8]. Other studies are mostly focused on me-
chanical strength and system modeling [9], determining material properties [10], hydraulic sys-
tems [11], pressure modeling [12], different press brake designs [13-15], optimization of the
© The Korean Society of Mechanical bending process [16], finite element analysis [17], determination of bending parameters [18],
Engineers and Springer-Verlag GmbH
Germany, part of Springer Nature 2023 and fatigue analysis of sheet metals shaped by the press brake [19]. The camera and sensor
4239
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
4240
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
the annotation for the mold position, Fig. 4(b) shows the anno-
tation for the mold type, and Fig. 4(c) shows the annotation for
holes on the various molds.
2.4 YOLOv4
DL models are powerful algorithms that are frequently used
in object detection, segmentation, and recognition [23]. The
development of DL methods, which started with the recom-
mendation of LeNet in 1998, stopped for a period because of
hardware inadequacies and continued with the introduction of
AlexNET, VGG, GoogleNET, and ResNET in 2012 [24-28].
Fig. 3. Experimental setup. After these developments, which are generally used for image
classification, the need to detect the object on an image quickly
without any size difference has emerged. With the recommen-
dation of SSD, R-CNN, Fast R-CNN, and Faster R-CNN mod-
els based on the region-based CNN approach, fast algorithms
with high detection rates have entered the Refs. [29-33]. These
methods are models that search for the most suitable object
with high accuracy by dividing the image into regions. Another
region-based DL model is the YOLO algorithm [34]. YOLO, a
CNN-based DL model, is a fast enough algorithm to detect
(a) (b)
objects on the image at one time. YOLO is constantly improv-
ing itself with different versions. In this study, the YOLOv4 algo-
rithm, which entered the literature in April 2020, was used. As
the processing load is very high in classical CNN methods,
YOLOv4 has been successful compared to its competitors in
real-time applications [35]. The YOLOv4 method uses regres-
sion to describe object positioning with bounding boxes. This
algorithm first divides the image into regions and searches for
(c)
the desired object within a specific region. The confidence
Fig. 4. (a) Image annotation for mold position detection; (b) image annota- score is determined by calculating the probability of the
tion for mold type detection; (c) image annotation for mold hole detection. searched object being in that region. This score gives the per-
centage of probability that the searched object is in that area.
processing systems operated collaboratively. MODBUS TCP/ However, overdetection and drawing several bounding boxes
IP protocol communicated with the robotic arm and Python around an object can occur in experiments. To prevent this
software. Fig. 3 shows the experimental setup of the robotic problem, a non-maximum suppression technique is applied to
arm-fed press brake machine. the objects inside the bounding boxes. This technique excludes
objects with a lower confidence score from evaluation and
2.3 Dataset and image annotation checks for the presence of a higher confidence bounding box
in the same region [35, 36]. YOLOv4 runs on the DarkNET
In this study, three different datasets were prepared for de- framework, which was developed with C/CUDA and has an
tection of mold positions, types, and holes. For mold position excellent performance. Therefore, the DarkNET framework
and mold type detection, a two-minute video was taken from a (https://github.com/AlexeyAB/darknet) was first downloaded to
distance of 40 cm using the USB camera on the robotic arm. the computer and the installation process was completed.
These videos were recorded frame by frame with a Python
script, and then two image datasets were created in .jpg format.
2.5 Network settings
To detect the mold hole, the robot arm was brought closer to
the molds and a two-minute video was taken and recorded as All three datasets were created from 1250 images in .jpg for-
images. The reason for this process is that after mold position mat. The data were divided into 75 % training and 25 % testing
and mold number detection, the robot moves closer and de- sets. Images with .txt files containing object coordinate values
tects the mold holes. Each dataset was annotated using the were saved in three different DarkNET folders. As YOLOv4 is
free browser-based “makesense” application (https://www. currently trained with the COCO dataset with 80 outputs, it
makesense.ai/). The annotated data were saved in YOLO for- should be customized according to the number of classes to be
mat as .txt files containing coordinate values. Fig. 4(a) shows used in this study. The pre-trained weights were downloaded
4241
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
as “yolov4.conv.137” and saved in the DarkNET folder average of the sum of the AP values of all classes (Eq. (6)).
(https://github.com/AlexeyAB/darknet). Some network hyper- The higher the AP and mAP, the better the detection perform-
parameters in the “yolov4.cfg” configuration file in the DarkNET ance of the model [37, 38].
folder have been changed for transfer learning according to the
purpose of the training. The number of filters according to the 1
4242
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
(a) (b)
(c) (d)
(e) (f)
Fig. 5. (a) Mold position detection without NMS; (b) mold position detection using NMS; (c) mold number detection without NMS; (d) mold number detection
using NMS; (e) mold hole detection without NMS; (f) mold hole detection using NMS.
area in the labeling performed by the operator and the bound- method of the OpenCV library was used for this process.
ing box area detected by YOLOv4 largely overlapped. The Fig. 5(a) shows the mold position detection without NMS,
limitation of the training process was that the Google COLAB and Fig. 5(b) shows the mold position detection using NMS
environment interrupted the user from the server after a certain and confidence score. Fig. 5(c) shows the mold type detection
working period. Therefore, the code scripts were run again to without NMS, and Fig. 5(d) shows the mold type detection
continue the training process from where it left off. However, using NMS and confidence scores. Fig. 5(e) shows the mold
because of these interruptions, the loss and mAP graphs of the hole detection without NMS, and Fig. 5(f) shows the mold hole
training process could not be drawn. detection using NMS and confidence score. As the last task,
the gripper must enter the middle of the mold hole. However,
the midpoint of the mold hole detected by YOLOv4 does not
3.2 Visual results
represent the hole center coordinates. The center coordinates
After obtaining the YOLOv4 weights, automatic object detec- were determined by traditional image processing methods.
tion experiments were conducted on the test data using the After the mold type and position detection, the robotic arm was
“cv2.dnn” module. Bounding boxes were drawn according to brought closer to the relevant mold. The mold hole was deter-
the estimated object coordinates. However, the algorithm can mined and bounding box coordinate values were recorded.
find the bounding box surrounding more than one object in the The color image was converted to a gray level and cropped
same region in the image divided into the SxS grid. The non- from the bounding coordinate values obtained in the previous
maximum suppression method was used to obtain the one with step. The image was converted to binary format by finding the
the highest confidence score from more than one bounding appropriate threshold with the Otsu thresholding method. Black
box representing the same region. The “cv2.dnn.NMSBoxes” holes in the object were filled. The notch under the gap pre-
4243
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
Fig. 7. Center coordinates (red points) of different molds obtained as a result of image processing and YOLOv4.
vents the exact middle point from being found. For this reason, hardware design, calibration, and communication protocols of
the morphological opening process was carried out using a the products were completed before the system was started.
disk structure element of r = 240 size. The center coordinates The entire system can be controlled through the main Python
of the obtaining round binary object were practically found with script developed. In the first step, the operator enters the de-
OpenCV’s contour and moment operations. In Fig. 6, the flow sired mold number into the system. In the second stage, the
diagram of the classical image processing methods performed previously trained mold position and mold number detection
after the mold hole detection process is given. In Fig. 7, the weights are automatically executed to obtain the information of
hole center coordinate values and drawings obtained in differ- all molds. Position information according to the mold number
ent molds are given. entered by the operator is sent to the robot using MODBUS
TCP/IP communication protocol and the robotic arm gets clos-
er to this mold. The mold hole region is detected automatically
3.3 Autonomous robotic manipulation
using YOLOv4 mold hole detection weights. According to the
In this section, the flow diagram of the DL and image proc- pipeline given in Fig. 6, classical image processing methods
essing-based system for the robotic arm to take the mold is are applied to this region, and center coordinate values are
explained. The system consists of two parts: Python + Image obtained. These values are sent to the robotic arm and the
Processing + YOLOv4 and Mitsubishi robotic software. The mold is entered according to the center coordinate values of
4244
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
4245
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
metal with image processing will be investigated. brake, Journal of Materials Processing Technology, 141 (1)
(2003) 143-154.
[11] Y. Altintaş and A. J. Lane, Design of an electro-hydraulic CNC
Acknowledgment press brake, International Journal of Machine Tools and Manu-
We would like to thank Mr. A. Vasıf Inan, the factory owner, facture, 37 (1) (1997) 45-59.
for allowing this study to be conducted at MVD Machinery In- [12] P. L. Teixeira, W. Vianna Jr, R. D. Penteado, P. Krus and V. J.
dustry. De Negri, Pressure modeling and analysis of a synchronized
hydraulic press brake with variable-speed pump, Proceedings
of the ASME/BATH 2015 Symposium on Fluid Power and Mo-
Nomenclature------------------------------------------------------------------ tion Control. ASME/BATH 2015 Symposium on Fluid Power
AP : Average precision and Motion Control, Chicago, USA (2015) V001T01A067.
F1-S : F1-score [13] N. Gwangwava, K. Mpofu, N. Tlale and Y. Yu, Sheet metal
IoU : Intersection of union productivity improvement through a new press brake design,
mAP : Mean average precision African Journal of Science, Technology, Innovation and Devel-
NMS : Non-maximum suppression opment, 6 (2) (2014) 135-144.
P : Precision [14] D. Mourtzis, V. Zogopoulos, I. Katagis and P. Lagios, Aug-
R : Recall mented reality based visualization of CAM instructions towards
YOLO : You only look once Industry 4.0 paradigm: a CNC bending machine case study,
DL : Deep learning Procedia CIRP, 70 (2018) 368-373.
TP : True positive [15] E. Nikolidakis and G. C. Vosniakos, A novel tool clamping
FP : False positive system for CNC press brakes, Proceedings in Manufacturing
TN : True negative Systems, 12 (2) (2017) 59.
FN : False negative [16] N. Kontolatis and G.-C. Vosniakos, Optimisation of press-
brake bending operations in 3D space, Journal of Intelligent
Manufacturing, 23 (3) (2012) 457.
References
[17] J. Bessa Pacheco and A. D. Santos, A study on the nose
[1] T. Altan and A. E. Tekkaya, Sheet Metal Forming: Fundamen- radius influence in press brake bending operations by finite
tals, 1st Ed., ASM International, Ohio, America (2012). element analysis, Key Engineering Materials, 554 (2013) 1432-
[2] R. Fournier, Sheet Metal Handbook: How to Form and Shape 1442.
Sheet Metal for Competition, Custom and Restoration Use, HP [18] F. Aydemir, B. G. Cakan, A. Durmuş and K. Çavdar, Determi-
Books, 575 (1989). nation of press brake bending parameters for hardox 400 steel,
[3] B. L. Rapien and S. Fournier, Fundamentals of Press Brake Uludağ University Journal of The Faculty of Engineering, 27 (1)
Tooling, 2nd Ed., München:Hanser Publishers (2010). (2022) 325-340.
[4] K. A. Stelson, An adaptive press brake control for strain- [19] K. E. Barth, G. K. Michaelson and R. M. Tennant, Fatigue
hardening materials, Journal of Engineering for Industry, 108 performance of singular and modular press-brake-formed steel
(2) (1986) 127-132. tub girders, Bridge Structures, 16 (1) (2020) 3-13.
[5] X. Yin, H. Wang and G. Wu, Path planning algorithm for bend- [20] R. Yan, L. Zhang, Z. Zhao, Y. Zhang and Y. Wang, A dynamic
ing robots, IEEE International Conference on Robotics and sheet metal bending angle measurement method based on
Biomimetics (ROBIO), IEEE, Guilin, China (2009) 392-395. line structured lasers, Lasers in Engineering, 38 (2017) 93-107.
[6] F. Xu, Q. Jiang, L. Rong, P. Zhou and J. Hu, Structural model [21] S. Raftopoulos and G. C. Vosniakos, A cost-effective device
and dynamic analysis of six-axis cartesian coordinate robot for for online measurement of sheet metal bending angle on CNC
sheet metal bending, International Journal of Advanced Ro- press brakes based on capacitive sensors, International Jour-
botic Systems, 16 (4) (2019). nal of Mechatronics and Manufacturing Systems, 13 (2) (2020)
[7] N. Kontolatis, G. C. Vosniakos and K. Kyriakopoulos, On pa- 153-168.
rametric toolpath design of a robot serving a press-brake, Pro- [22] MVD Machinery Industry Inc., Press Brake With Robot, YouTube,
ceedings 19th Flexible Automation and Intelligent Manufactur- https://www.youtube.com/watch?v=jna2zEnJUhk&ab_channel=
ing Conference, Middlesbrough, United Kingdom (2009) 6-8. MVD.
[8] S. K. Gupta, D. A. Bourne, K. H. Kim and S. S. Krishnan, Auto- [23] M. Hassaballah and A. I. Awad, Deep Learning in Computer
mated process planning for sheet metal bending operations, Vision: Principles and Applications, CRC Press (2020).
Journal of Manufacturing Systems, 17 (5) (1998) 338-360. [24] Y. LeCun, L. Bottou, Y. Bengio and P. Haffner, Gradient-
[9] D. Lovrec and M. Kastrevc, Modelling and simulating a con- based learning applied to document recognition, Proceedings
trolled press-brake supply system, International Journal of of the IEEE, 86 (11) (1998) 2278-2324.
Simulation Modelling, 10 (3) (2011) 133-144. [25] A. Krizhevsky, I. Sutskever and G. E. Hinton, Imagenet classi-
[10] R. J. Mentink, D. Lutters, A. H. Streppel and H. J. J. Kals, fication with deep convolutional neural networks, Communica-
Determining material properties of sheet metal on a press tions of the ACM, 60 (6) (2017) 84-90.
4246
Journal of Mechanical Science and Technology 37 (8) 2023 DOI 10.1007/s12206-023-0740-y
[26] K. Simonyan and A. Zisserman, Very deep convolutional multaneously in orchard using YOLOv4 for robotic pollination,
networks for large-scale image recognition, arXiv:1409.1556 Computers and Electronics in Agriculture, 193 (2022) 106641.
(2014). [38] A. M. Roy, R. Bose and J. Bhaduri, A fast accurate fine-grain
[27] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Angue- object detection model based on YOLOv4 deep neural network,
lov, D. Erhan, V. Vanhoucke and A. Rabinovich, Going deeper Neural Computing and Applications, 34 (5) (2022) 3895-3921.
with convolutions, Proceedings of The IEEE Conference On
Computer Vision And Pattern Recognition, Massachusetts,
USA (2015) 1-9.
[28] K. He, X. Zhang, S. Ren and J. Sun, Deep residual learning Muhammet Üsame Öziç graduated
for image recognition, Proceedings of The IEEE Conference from the Department of Electronics Engi-
On Computer Vision And Pattern Recognition, Las Vegas, neering of Uludağ University with a B.Sc.
USA (2016) 770-778. degree in 2010, from the Department of
[29] P. Bharati and A. Pramanik, Deep learning techniques—R- Electrical and Electronics Engineering of
CNN to mask R-CNN: A survey, Computational Intelligence in Selcuk University with an M.Sc. degree
Pattern Recognition: Proceedings of CIPR (2020) 657-668. in 2013, and the Electrical & Electronics
[30] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C. Y. Fu Engineering Department of Selcuk Uni-
and A. C. Berg, SSD: single shot multibox detector, Computer versity with a Ph.D. degree in 2018. His professional interests
Vision - ECCV 2016. ECCV 2016. Lecture Notes in Computer include deep learning, MRI-based frameworks, medical image
Science, Springer, Cham, 9905 (2016) https://doi.org/10.1007/ analysis, image processing, image reconstruction, robotics,
978-3-319-46448-0_2. and pattern recognition.
[31] R. Girshick, Fast R-CNN, Proceedings of The IEEE Interna-
tional Conference on Computer Vision, Santiago, Chile (2015) Mücahid Barstuğan graduated from the
1440-1448. Department of Electronics Communica-
[32] S. Ren, K. He, R. Girshick and J. Sun, Faster R-CNN: to- tion Engineering at Kocaeli University
wards real-time object detection with region proposal networks, with B.Sc. degree in 2010, from the Elec-
IEEE Transactions on Pattern Analysis And Machine Intelli- trical & Electronics Engineering Depart-
gence, 39 (6) (2017) 1137-1149. ment of Selcuk University with an M.Sc.
[33] R. Girshick, J. Donahue, T. Darrell and J. Malik, Rich feature degree in 2014, and Electrical & Electron-
hierarchies for accurate object detection and semantic segmen- ics Engineering Department of Konya
tation, Proceedings of The IEEE Conference on Computer Vi- Technical University with a Ph.D. degree in 2019. His profes-
sion And Pattern Recognition, Ohio, USA (2014) 580-587. sion includes machine learning, Mitsubishi robotic systems and
[34] J. Redmon, S. Divvala, R. Girshick and A. Farhadi, You only programming, image processing, image segmentation, image
look once: unified, real-time object detection, Proceedings of reconstruction, and PLC programming.
The IEEE Conference on Computer Vision And Pattern Rec-
ognition, Las Vegas, USA (2016) 779-788. Atakan Özdamar graduated from the
[35] A. Bochkovskiy, C. Y. Wang and H. Y. M. Liao, YOLOV4: Department of Electrical & Electronics
optimal speed and accuracy of object detection, arXiv:2004. Engineering with a B.Sc. degree in 2019.
10934 (2020). He is a research engineer at MVD Ma-
[36] D. Wang, C. Li, S. Wen, Q. L. Han, S. Nepal, X. Zhang and Y. chinery Industry, Research and Devel-
Xiang, Daedalus: breaking nonmaximum suppression in object opment Center (R&D) in Konya, Turkey.
detection via adversarial examples, IEEE Transactions on Cy- At the same time, he is pursuing his the-
bernetics, 52 (8) (2021) 7427-7440. sis work as a graduate student at the
[37] G. Li, R. Suo, G. Zhao, C. Gao, L. Fu, F. Shi, J. Dhupia, R. Li Department of Electrical and Electronics Engineering at Konya
and Y. Cui, Real-time detection of kiwifruit flower and bud si- Technical University.
4247