# Marker Identification of Disc Workpiece Based on HOG-SVM Classifier

Authors: Ben Liu; Feng Gao; Pengxuan Zhao; Yan Li; Wenqiang Li
Journal: Mobile Information Systems
 (2022)

---

## Abstract

With the less humanized trend of manufacturing production line gradually progressing, real-time recording and tracking of workpieces information have become an essential way to implement efficient management. To collect and identify the workpiece marker is of great significance for product information statistics and quality traceability. Aiming at the problems of inaccurately positioning, difficultly segmenting, and slowly recognizing for capturing the marker of disc workpieces distributed circularly, this study proposes a projection segmentation algorithm based on polar coordinate inverse transformation to locate and separate the circularly arranged marker and extract the total separated characters. The features of the directional gradient histogram (HOG) of characters are used as the input of the support vector machine (SVM) model, and after training, a workpiece marker recognition classifier is obtained. The experiment results show that the recognition accuracy of markers composed of letters and numbers is over 97% by the proposed method. Our proposed method outperformed state-of-the-art approaches in achieving higher recognition accuracy rate with the SVM classifier.


---

## Body

## 1. Introduction

With the gradual application of industry 4.0 to the modern manufacturing industry, intelligentialization and digitalization have begun to advance automatic production lines. In order to ensure the effective implementation of enterprise’s digital configuration, a workpiece identification system should be established to improve the management level of production process, and then the transferring efficiency of logistics links would be enhanced and the error rate can be reduced. Therefore, it is necessary to assign unique industrial labels to all workpieces as the basis for making out their identities. Compared with the traditional tag or printed marker, which may desquamate or wear over a long time, laser marking can permanently etch the serial numbers on the surface of the workpiece presented by various types of characters containing the basic production information of the workpiece. Problems with these approaches are stability and robustness and particularly light changes that require special attention from researchers. Other than these problems, markers’ speed of recognition and reliability can affect the accuracy [1].Collecting and identifying the workpiece label as an important information carrier for today’s automatic production line can be used for product quality statistics, quality traceability, and even for quality supervision during the whole life cycle of products. It has played a crucial role in the machining and transformation of industrial production. In order to improve the efficiency of workpiece marker detection and recognition, optical character recognition (OCR) technology has been widely adopted in industrial production. Quality traceability has been an important issue in production. Marking technology can provide a comprehensive solution of the earlier mentioned problem to obtain fast as well as traceable results.To realize OCR, it needs to determine the position of the character region to be recognized, that is, character region positioning. Recognizing OCR’s importance is a continuous effort from researchers that requires end-to-end machine learning based solutions [2].The currently used methods and technologies of character location include convolutional neural networks (CNNs), color segmentation, multilayer self-coding combined with SVM, and constrained AdaBoost algorithm and binary technology of kernel density function preprocessing [3–9]. In order to identify the characters in the license plate quickly and accurately, HAAR features were used to train AdaBoost classifier for finding the characters’ location, and the separated characters were recognized by the trained BP neural network [3]. Compared with the traditional neural network detection method, the positioning detection of steel plate and slab number based on MobileNet acceleration model also improved the detection speed and reduced the network weights [4–10]. LocNet-based positioning module could replace bounding box regression module to enhance the positioning accuracy of text detector. Furthermore, an improved YOLOV3 algorithm achieved the same effect [11, 12]. However, intelligent data augmentation can be proposed to overcome the insufficient data for industrial detection. Therefore, the proposed method in this study aims to improve identification and generalizes the model for similar industrial items.Once marker region is detected the character segmentation is needed to recognize character strings one by one, and the effect of character segmentation directly affects the recognition accuracy. Character segmentation can be realized by using connected domain labeling method and horizontal or vertical projection method [3, 13]. There are some algorithms to effectively divide the characters typed serially in horizontal setting or vertical setting, e.g., character segmentation algorithm based on eigenvalue, region maximum segmentation algorithm, and character segmentation algorithm combining the improved color filling algorithm with the improved dripping algorithm [14–16]. For the nonlinear segmentation of Roman handwritten characters, the suspected character boundary of cursive script was searched by heuristic derivation, and the effective boundary was screened out by an integrated neural network. The top-down handwritten text line segmentation method was used to realize the character segmentation of nonspaced handwritten documents through a detailed enlargment [17, 18]. To deal with the segmentation of embossed characters in low-quality images with the uneven brightness, the iterative closed-loop feedback segmentation method based on segmentation effect evaluation function was viable [19]. Study [20] proposed a segmentation algorithm of cohesive characters based on the optimal segmentation path, which improved the segmentation effect and accuracy of detonator coding.After the characters in a string are segmented individually one by one, in some scenes, the convolutional recurrent neural network (CRNN) as an algorithm of segmentation and font recognition realized the recognition of steel slab number and overcame the problem of character adhesion that traditional image processing algorithms cannot solve [10]. Google Tesseract-OCR character recognition engine was effectively applied to the situation of English character recognition [21]. A CNN algorithm can recognize text, and there are several methods, including GA-SVM algorithm, transfer learning method, character recognition method based on capsule network, and number recognition algorithm based on discriminant vector [22–24]. OCR technology has a high recognition rate for the horizontal text with regular distribution, but there are some problems such as illegible handwriting, inaccurate positioning, difficult segmentation, and low recognition efficiency for the circular text information marked by laser. Deep learning can quickly identify characters, however, its modeling depends heavily on a large number of training samples. For the conditions of the small samples or difficult sample acquisition, the recognition accuracy of deep learning model would be regressed. In this paper, the image clarity is improved by denoising and enforcement treatment, the projection segmentation method based on the inverse polar coordinate transformation, which is used to accurately segment and extract individual characters, and the HOG features of characters as the inputs are used to train SVM classifier. All the characters allocated circularly on the disc workpiece are identified automatically. Denoising can remove noise from noisy images and restores the original image form. The goal is to learn from the transforming between the source and target domains. The flowchart of the identification algorithm proposed in this paper is shown in Figure 1.Figure 1
The flowchart of the proposed method.Figure1 shows us the flowchart of the proposed method. The initial step in the proposed method is the selection of an input image, it aims at removing noise and enhancing it in the second step. The process of positioning of character area mainly takes place in steps 3 and 4 as shown in Figure 1. In the next 4 steps, features extraction, segmentation, polar transformation, and character area positioning adjustment are performed. In the final step, marker identification is done through the SVM classifier.Based on the above-mentioned problems and our proposed solution, we can list out the main contributions of this paper as follows.(1)
This paper proposed an improved HOG-SVM method for marker identification of disc workpiece.(2)
This paper proposed to use the denoising method to eliminate small connected areas on the premise of ensuring the integrity of characters.The remainder of this paper is organized as follows: Section2 presents the literature review of related studies on the research topic. Section 3 and 4 present the positioning and segmentation of workpiece labels, respectively. Section 5 presents character recognition based on HOG-SVM. The summary of the proposed research, its results and main findings are presented in Section 6.


## 2. Literature Review

Track workpiece is advantageous for forging technology. A product quality can be analyzed by matching the physical workpiece with the controlling process knowledge. Workpiece tracking was performed in [25] by tagging experiments and reviews. However, printed codes can bias the DIC based identification and fail to identify the engraved codes due to bad lighting. Therefore, a standard system is needed for improved results.Heterogeneous surface markers were studied in [26] to track workpiece surface with the help of high-speed imaging. The identification of certain strain fields was performed by calculating the relative displacement of heterogeneous surface markers.To log and track new raw materials for a quick pull is a complex job. More complexity is added by the lack of workpiece stack without appropriate logs. A recent research proposed a method based on logging the visible part location as well as timestamps. A graph-based model was used to highlight the part interactions and stack formation for those parts which are not directly observable [27]. The proposed research has been validated by conducting simulation and experiments. This research work has potential to gauge the marker identification of disc workpiece by extending it.Machine visions have been applied recently to solve the problem of identifying the location of scattered workpieces [28]. The proposed approach aims to segment the adhesive workpieces and performs their extraction by speeding up the robust features. SVM model has been applied to the proposed research. The result shows that positioning error is low as expected in the study. The SVM can be used in the current study by working as a workpiece marker recognition classifier.


## 3. Positioning of Workpiece Label

### 3.1. Coarse Positioning of Workpiece Marker

Accurately knowing the location of the workpiece marker is a necessary prerequisite for its segmentation. According to the features of the circular distribution of the workpiece marker in the synchronization ring, combined with the design size requirements, the workpiece marker region is located coarsely firstly, and the disc object to be detected is shown in Figure2.Figure 2
Synchronization ring workpiece.The gray image is swept by a circular window with a diameter slightly larger than that of the external profile of the synchronization ring to be measured. When the gray values of the pixels at the boundary of the circular window are 255, the ROI (region of interest) of the workpiece is extracted, as shown in Figure3.Figure 3
Workpiece.The ROI refers to a target area in the given image that plays an important role in improving the accuracy and efficiency of background information regarding its processing and detection.In order to improve the contrast between the character and noncharacter zones, the gamma transform is used to enhance the image expressed as follows:(1)Vout=CVinγ,where Vout is gray value after gamma conversion, C is the gray scale factor, Vin is the gray value of the image, and γ is a factor to determine the degree of the whole transformation. Image enhancement contrast of character area is shown in Figure 4.Figure 4
Contrast chart of image enhancement: (a) original image and (b) after gamma transformation.
(a)(b)According to the design size of the synchronization ring and the geometric characteristics of the character allocations, the character region position can be obtained by referring it to the diameter of the dedendum circle of the synchronization ring. The dedendum circle diameter and tooth height are accurately extracted to coarsely locate workpiece marker, by which the diameter of dedendum circle is calculated using dimension measurement method.The Canny edge detection method is employed to extract the contour of the workpiece. It is a multistep method used for the detection of edges from an input image. The center of synchronization ring is determined coarsely by centroid method expressed as follows:(2)Cx=∑AtxNCy=∑AtyNt=1,2,3,…,N,where Cx and Cy are the coordinate of the center of the synchronization ring in the pixel coordinate system, A is the point set of the outer contour, and N is the number of the outer contour pixel points. A centroid method is generally applied to localize the node. Therefore, the centroid method works as a sub-pixel location positioning.The distances from each outer contour point and tooth root point to the center of the synchronization ring are calculated based on the geometric configuration of the synchronization ring. The least square method is used to fit circles for the tooth vertex and tooth root point. The circle is expressed as follows:(3)x−a2+y−b2=r2,where a and b are X and Y coordinates of the centers of the addendum circle or dedendum circle, respectively, and r is the corresponding radius.According to the principle of minimum sum of squares of distances required by least square fitting, there are some definitions as follows:(4)C=N∑Xi2−∑Xi∑XiD=N∑XiYi−∑Xi∑YiE=N∑Xi3+N∑XiYi2−∑Xi2+Yi2∑XiG=N∑Yi2−∑Yi∑YiH=N∑Xi2Yi+N∑Yi3−∑Xi2+Yi2∑Yi,where formula (4) is substituted into equation (3) and the parameters in (3) are expressed as follows:(5)a=HD−EG−2CG−D2b=HC−ED−2D2−CGr=12a2+b2+4∑Xi2+Yi2+a∑Xi+b∑YiN.Therefore, the diameters (2r) of the addendum circle, the dedendum circle, and the actual coordinates (a, b) of the centers of the circles can be determined, and the coarse positioning of the workpiece marker for the synchronization ring is realized, as shown in Figure 5.Figure 5
Rough positioning map of projection segmentation method.To implement character segmentation algorithm based on projection method requires inverse polar transformation of Figure5. In order to prevent the expansion line from being lain in the character area, it is necessary to accurately locate the character area and rotate it to a proper position. Firstly, after coarsely positioning the image is binarized with adaptive threshold algorithm, as shown in Figure 6. The small noise in binary image is eliminated by morphological opening operation. According to the boundary tracking algorithm, the topological structure of the area where the label in Figure 6 is located is analyzed, and the ring contour mask is constructed. By using mask and image to perform bitwise exclusive or operation, removes the inner and outer contours of the circle, and determines the position of the character area. The processed result is shown in Figure 7.Figure 6
Binary image with noise.Figure 7
Denoised character area.The denoised character region is processed with morphological expansion, which makes the adjacent connected components merge to form an integral region containing all label characters. If the minimum circumscribed rectangle of the connected component is obtained, the position of the character area can be determined according to the center of the dedendum circle and the center of the minimum circumscribed rectangle. Therefore, the corresponding rotation angle can be determined.The minimum circumscribed rectangle is shown in Figure8. The arc area occupied by the characters corresponding to θ in the image realizes the positioning of the characters.Figure 8
Minimum circumscribed rectangle.


## 3.1. Coarse Positioning of Workpiece Marker

Accurately knowing the location of the workpiece marker is a necessary prerequisite for its segmentation. According to the features of the circular distribution of the workpiece marker in the synchronization ring, combined with the design size requirements, the workpiece marker region is located coarsely firstly, and the disc object to be detected is shown in Figure2.Figure 2
Synchronization ring workpiece.The gray image is swept by a circular window with a diameter slightly larger than that of the external profile of the synchronization ring to be measured. When the gray values of the pixels at the boundary of the circular window are 255, the ROI (region of interest) of the workpiece is extracted, as shown in Figure3.Figure 3
Workpiece.The ROI refers to a target area in the given image that plays an important role in improving the accuracy and efficiency of background information regarding its processing and detection.In order to improve the contrast between the character and noncharacter zones, the gamma transform is used to enhance the image expressed as follows:(1)Vout=CVinγ,where Vout is gray value after gamma conversion, C is the gray scale factor, Vin is the gray value of the image, and γ is a factor to determine the degree of the whole transformation. Image enhancement contrast of character area is shown in Figure 4.Figure 4
Contrast chart of image enhancement: (a) original image and (b) after gamma transformation.
(a)(b)According to the design size of the synchronization ring and the geometric characteristics of the character allocations, the character region position can be obtained by referring it to the diameter of the dedendum circle of the synchronization ring. The dedendum circle diameter and tooth height are accurately extracted to coarsely locate workpiece marker, by which the diameter of dedendum circle is calculated using dimension measurement method.The Canny edge detection method is employed to extract the contour of the workpiece. It is a multistep method used for the detection of edges from an input image. The center of synchronization ring is determined coarsely by centroid method expressed as follows:(2)Cx=∑AtxNCy=∑AtyNt=1,2,3,…,N,where Cx and Cy are the coordinate of the center of the synchronization ring in the pixel coordinate system, A is the point set of the outer contour, and N is the number of the outer contour pixel points. A centroid method is generally applied to localize the node. Therefore, the centroid method works as a sub-pixel location positioning.The distances from each outer contour point and tooth root point to the center of the synchronization ring are calculated based on the geometric configuration of the synchronization ring. The least square method is used to fit circles for the tooth vertex and tooth root point. The circle is expressed as follows:(3)x−a2+y−b2=r2,where a and b are X and Y coordinates of the centers of the addendum circle or dedendum circle, respectively, and r is the corresponding radius.According to the principle of minimum sum of squares of distances required by least square fitting, there are some definitions as follows:(4)C=N∑Xi2−∑Xi∑XiD=N∑XiYi−∑Xi∑YiE=N∑Xi3+N∑XiYi2−∑Xi2+Yi2∑XiG=N∑Yi2−∑Yi∑YiH=N∑Xi2Yi+N∑Yi3−∑Xi2+Yi2∑Yi,where formula (4) is substituted into equation (3) and the parameters in (3) are expressed as follows:(5)a=HD−EG−2CG−D2b=HC−ED−2D2−CGr=12a2+b2+4∑Xi2+Yi2+a∑Xi+b∑YiN.Therefore, the diameters (2r) of the addendum circle, the dedendum circle, and the actual coordinates (a, b) of the centers of the circles can be determined, and the coarse positioning of the workpiece marker for the synchronization ring is realized, as shown in Figure 5.Figure 5
Rough positioning map of projection segmentation method.To implement character segmentation algorithm based on projection method requires inverse polar transformation of Figure5. In order to prevent the expansion line from being lain in the character area, it is necessary to accurately locate the character area and rotate it to a proper position. Firstly, after coarsely positioning the image is binarized with adaptive threshold algorithm, as shown in Figure 6. The small noise in binary image is eliminated by morphological opening operation. According to the boundary tracking algorithm, the topological structure of the area where the label in Figure 6 is located is analyzed, and the ring contour mask is constructed. By using mask and image to perform bitwise exclusive or operation, removes the inner and outer contours of the circle, and determines the position of the character area. The processed result is shown in Figure 7.Figure 6
Binary image with noise.Figure 7
Denoised character area.The denoised character region is processed with morphological expansion, which makes the adjacent connected components merge to form an integral region containing all label characters. If the minimum circumscribed rectangle of the connected component is obtained, the position of the character area can be determined according to the center of the dedendum circle and the center of the minimum circumscribed rectangle. Therefore, the corresponding rotation angle can be determined.The minimum circumscribed rectangle is shown in Figure8. The arc area occupied by the characters corresponding to θ in the image realizes the positioning of the characters.Figure 8
Minimum circumscribed rectangle.


## 4. Segmentation of Workpiece Label

Segmentation algorithm is a common character projection method. However, the projection segmentation based method is only suitable for the traditional linear distribution of character images. Therefore, in view of the circular distribution of characters involved in this paper, it is necessary to reverse the polar coordinate transformation of the character area and expand the circular character area into a rectangle, so that the circular distribution of characters can be transformed into a linear distribution. The processed result is shown in Figure9.Figure 9
Character area after polar coordinate expansion.Canny edge detection is performed on the expanded character area to obtain the edge image of the character area, as shown in Figure10. After applying the steps of Candy edge detection, we were able to get the following results.Figure 10
Edge image of character area.Morphological operations of Canny edge detection method were introduced. The first operation is known as “close operation” that smooth the contours and fills the gaps in a contour. On the other hand, the second method “open operation” contours the objects and breaks the narrow strips [29]. Based on the above-given morphological operations, the close operation is used to fill the minimum holes in the characters and enhance the characters, and then open operation is used to eliminate tiny noise. Binarization of the character area is used to construct the mask image. In order to eliminate the upper and lower boundary lines, the height of the mask is slightly less than that of the character area, so the mask image is corroded. The upper and lower boundary lines can be eliminated by operating on the edge image and mask image, and the effect is shown in Figure 11.Figure 11
Character area after removing the border.There are still a few large-size noises in the image, which would affect the efficiency and accuracy of projection segmentation and need to be removed. However, the traditional filtering algorithm and morphological operation have been unable to eliminate large-size noise on the premise of ensuring character integrity. Therefore, a denoising method is used to eliminate small connected domains. Therefore, a boundary tracking algorithm is used to detect the connected component in Figure11, calculate the threshold according to the connected component, and screen the connected component of characters. Later we put the connected component of the filtered character into a new image, and the processed result is shown in Figure 12.Figure 12
Denoised character area.Projection segmentation algorithm includes horizontal projection and vertical projection. The horizontal projection is used to determine the number of lines of characters or the heights of character areas, and the vertical projection is used to determine the width of each character. By projecting horizontally and vertically image in Figure12, the region where the characters are located can be determined, as shown in Figure 13. According to the projection histogram, the characters are divided and saved. The results are shown in Figure 14.Figure 13
Projection histogram of character area.Figure 14
Segmentation result using the projection method.Figure14 shows segmentation results based on the projection method. The segmentation results were drawn after using projection histogram from Figure 13.


## 5. Character Recognition Based on HOG-SVM

### 5.1. HOG Feature Extraction of Character Image

HOG algorithm can represent the edge or shape information in the image in the form of gradient direction histogram [30]. HOG features are extracted from the segmented single-character images, which are used as input into SVM as feature vectors for training to obtain a character recognition classifier. The process of extracting HOG features of an image is as follows: firstly, the image is divided into a plurality of cells, and each cell is composed of numerous pixels. Secondly, the gradient direction histogram of all pixels in each cell is calculated. The interval composed of several cells is called a block, and an image can be divided into several blocks. Finally, the cells in each interval are normalized to obtain the final HOG features.The dimension of HOG features is determined by image size, cell size, block size, and other parameters, and the specific calculation formula is as follows:(6)N=cb×bs/cs2×w−bs+bt×h−bs+btbt2,where w、h represent the width and height of the image, respectively, cb indicates the dimension of bin in each cell, bs indicates the size of the block, cs indicates the size of the cell, bt indicates the step size of block movement in the image. In order to avoid the feature vector dimension being too large and reduce the recognition efficiency, the image size is usually adjusted during training of a machine learning classifier and reduce the feature vector dimension. The HOG features extracted from the segmented single character are shown in Figure 15.Figure 15
Characteristics of single character HOG.Figure15 shows us the extraction of both numeric and English letter HOG characters. As one number (3) and single letter (R) are used for HOG extraction, it refers to a single character HOG.


### 5.2. Character Recognition Based on SVM

Support vector machine (SVM) is a commonly used machine learning classification algorithm. The principle diagram of SVM classification is shown in Figure16.Figure 16
Schematic diagram of SVM classification.Figure16 shows us the schematic diagram of the proposed SVM classifier. Assuming that there are two types of sample points in two-dimensional space, which are linearly separable, it is necessary to find hyperplane A and separate the two types of sample points. Suppose the expression of the hyperplane is(7)ωTx+b=0,where ω=ω1,ω2T is applied to control the direction of the hyperplane. x=x1,x2T andintercept b are used to control the hyperplane position.Eachxi is assigned a category label yi, that is, add category label yi to each xi, each xi add a category label. yi, is(8)yi=+1for class1−1for class2.The goal of SVM is to find a hyperplane that maximizes the classification intervalw, and W=2d, the problem is transformed into finding the maximum value of the distance d from the support vector to the hyperplane, and its expression is shown in the following formula:(9)d=ωTx+bω.The problem is turned into calculating the minimum of1/2ω, then the optimal hyperplane needs to meet the conditions as follows:(10)minω,b12ω2,styiωTxi+b≥1,i=1,2,…,m..In the case of linear inseparability, it is necessary to introduce a kernel function, which is used to map samples to a higher dimensional space and make samples linearly separable in the new dimensional space. Compared with the traditional classifier model, SVM has higher accuracy in solving small sample data classification.In this paper, the HOG-SVM algorithm is used to construct a character recognition classifier, and the training process is as follows:(1)
We process input images to locate character areas and segment characters. Then, we build sample library, mark according to character types, and divide into training set and test set.(2)
Afterward, we normalize the image size to 48∗ 48 and extract HOG features from the normalized image.(3)
We use input features into SVM classifier for supervised training.Through the above steps, the SVM character recognition classifier is obtained. The SVM model parameters used in this paper are shown in Table1.Table 1
Parameters of Hog-SVM character classifier.
TypeParameter valueKernel functionGaussianHOG feature dimension900Maximum number of iterations1000Maximum acceptable error1e − 7We normalize the size of the image to be recognized to 48∗ 48, extract the HOG feature of the character image, input it into SVM classifier to recognize the character, and finally return the character recognition result.In this paper, 600 character pictures from different camera angles and different lighting conditions are selected as training samples. There are 200 character pictures as testing samples. The overall recognition rate is shown in Table2.Table 2
Character recognition performance.
Test sampleNumber of test samplesCorrect identification quantityRecognition accuracy rate (%)A2020100E2020100F201890S2020100T201995Letter100979712020100220201003201995520201006201995Number1009898Two categories of test samples (letter and number) are listed along with the number of test samples, correct identification quantity, and recognition accuracy rate. Test samples (A, E, F, S, and T) denote the letter category and (1, 2, 3, 5, and 6) refer to number category (Table2). Each test sample in two categories contains 20 test samples.The average time consumed is 6.85 s, and the result show that that character segmentation recognition method proposed in this paper has a good recognition effect on the labels of disc-like workpieces distributed in a ring shape.There is a slight difference in the correct identification quantity between two categories. Letter category of test sample gained 97% correct identification from the proposed approach, and number category gained 98% correct identification. The results show that the proposed approach is equally significance for the identification of letter and number characters.SVM classifier is usually applied to dichotomy issue, and this research required to test five samples in each of two categories. There were 20 test samples in each test, as shown in Table2. Comparing recognition accuracy rate results of a study [31] as 93.6893% with this study, we can conclude that the proposed research is better than the existing work. This improved recognition accuracy rate might be due to size and training of SVM classifier in this study. In another study [32], character recognition accuracy was obtained as 94.43% using SVM classifier along with the feature extraction algorithm. This accuracy rate is less than the accuracy results achieved in our research work. Generally, using lower training cycles provides a better accuracy as compared with the higher training cycles.Present research mainly uses recognition accuracy rate as an evaluation measure for a classification method. A few more evaluation measures, such as build time of a classifier, precision, and misclassification rates have been widely used in the literature [33]. This study shows a limitation in using these measures. Other than these missed measures, mean absolute errors (MAE) and root mean square error (EMSE) [34] can be applied to evaluate the classifiers for the classification and prediction issues.


## 5.1. HOG Feature Extraction of Character Image

HOG algorithm can represent the edge or shape information in the image in the form of gradient direction histogram [30]. HOG features are extracted from the segmented single-character images, which are used as input into SVM as feature vectors for training to obtain a character recognition classifier. The process of extracting HOG features of an image is as follows: firstly, the image is divided into a plurality of cells, and each cell is composed of numerous pixels. Secondly, the gradient direction histogram of all pixels in each cell is calculated. The interval composed of several cells is called a block, and an image can be divided into several blocks. Finally, the cells in each interval are normalized to obtain the final HOG features.The dimension of HOG features is determined by image size, cell size, block size, and other parameters, and the specific calculation formula is as follows:(6)N=cb×bs/cs2×w−bs+bt×h−bs+btbt2,where w、h represent the width and height of the image, respectively, cb indicates the dimension of bin in each cell, bs indicates the size of the block, cs indicates the size of the cell, bt indicates the step size of block movement in the image. In order to avoid the feature vector dimension being too large and reduce the recognition efficiency, the image size is usually adjusted during training of a machine learning classifier and reduce the feature vector dimension. The HOG features extracted from the segmented single character are shown in Figure 15.Figure 15
Characteristics of single character HOG.Figure15 shows us the extraction of both numeric and English letter HOG characters. As one number (3) and single letter (R) are used for HOG extraction, it refers to a single character HOG.


## 5.2. Character Recognition Based on SVM

Support vector machine (SVM) is a commonly used machine learning classification algorithm. The principle diagram of SVM classification is shown in Figure16.Figure 16
Schematic diagram of SVM classification.Figure16 shows us the schematic diagram of the proposed SVM classifier. Assuming that there are two types of sample points in two-dimensional space, which are linearly separable, it is necessary to find hyperplane A and separate the two types of sample points. Suppose the expression of the hyperplane is(7)ωTx+b=0,where ω=ω1,ω2T is applied to control the direction of the hyperplane. x=x1,x2T andintercept b are used to control the hyperplane position.Eachxi is assigned a category label yi, that is, add category label yi to each xi, each xi add a category label. yi, is(8)yi=+1for class1−1for class2.The goal of SVM is to find a hyperplane that maximizes the classification intervalw, and W=2d, the problem is transformed into finding the maximum value of the distance d from the support vector to the hyperplane, and its expression is shown in the following formula:(9)d=ωTx+bω.The problem is turned into calculating the minimum of1/2ω, then the optimal hyperplane needs to meet the conditions as follows:(10)minω,b12ω2,styiωTxi+b≥1,i=1,2,…,m..In the case of linear inseparability, it is necessary to introduce a kernel function, which is used to map samples to a higher dimensional space and make samples linearly separable in the new dimensional space. Compared with the traditional classifier model, SVM has higher accuracy in solving small sample data classification.In this paper, the HOG-SVM algorithm is used to construct a character recognition classifier, and the training process is as follows:(1)
We process input images to locate character areas and segment characters. Then, we build sample library, mark according to character types, and divide into training set and test set.(2)
Afterward, we normalize the image size to 48∗ 48 and extract HOG features from the normalized image.(3)
We use input features into SVM classifier for supervised training.Through the above steps, the SVM character recognition classifier is obtained. The SVM model parameters used in this paper are shown in Table1.Table 1
Parameters of Hog-SVM character classifier.
TypeParameter valueKernel functionGaussianHOG feature dimension900Maximum number of iterations1000Maximum acceptable error1e − 7We normalize the size of the image to be recognized to 48∗ 48, extract the HOG feature of the character image, input it into SVM classifier to recognize the character, and finally return the character recognition result.In this paper, 600 character pictures from different camera angles and different lighting conditions are selected as training samples. There are 200 character pictures as testing samples. The overall recognition rate is shown in Table2.Table 2
Character recognition performance.
Test sampleNumber of test samplesCorrect identification quantityRecognition accuracy rate (%)A2020100E2020100F201890S2020100T201995Letter100979712020100220201003201995520201006201995Number1009898Two categories of test samples (letter and number) are listed along with the number of test samples, correct identification quantity, and recognition accuracy rate. Test samples (A, E, F, S, and T) denote the letter category and (1, 2, 3, 5, and 6) refer to number category (Table2). Each test sample in two categories contains 20 test samples.The average time consumed is 6.85 s, and the result show that that character segmentation recognition method proposed in this paper has a good recognition effect on the labels of disc-like workpieces distributed in a ring shape.There is a slight difference in the correct identification quantity between two categories. Letter category of test sample gained 97% correct identification from the proposed approach, and number category gained 98% correct identification. The results show that the proposed approach is equally significance for the identification of letter and number characters.SVM classifier is usually applied to dichotomy issue, and this research required to test five samples in each of two categories. There were 20 test samples in each test, as shown in Table2. Comparing recognition accuracy rate results of a study [31] as 93.6893% with this study, we can conclude that the proposed research is better than the existing work. This improved recognition accuracy rate might be due to size and training of SVM classifier in this study. In another study [32], character recognition accuracy was obtained as 94.43% using SVM classifier along with the feature extraction algorithm. This accuracy rate is less than the accuracy results achieved in our research work. Generally, using lower training cycles provides a better accuracy as compared with the higher training cycles.Present research mainly uses recognition accuracy rate as an evaluation measure for a classification method. A few more evaluation measures, such as build time of a classifier, precision, and misclassification rates have been widely used in the literature [33]. This study shows a limitation in using these measures. Other than these missed measures, mean absolute errors (MAE) and root mean square error (EMSE) [34] can be applied to evaluate the classifiers for the classification and prediction issues.


## 6. Conclusions

In this study, a character segmentation and recognition based on projection method are proposed and implemented to identify the markers of disc-like workpieces with the circular distribution.This study proposed to construct a character recognition classifier using the HOG-SVM algorithm for marker identification of disc workpiece. A dataset has been used to evaluate the proposed HOG-SVM algorithm. The authors have used a number of test samples from this dataset to train and evaluate the proposed algorithm. The experimental results show that the recognition accuracy rate of annular distribution markers of disc-like workpieces is over 97%, which is better than state-of-the-art approaches. Therefore, HOG-SVM classifier has been selected as a best classifier impartially. However, the evaluation of the proposed algorithm can be extended by using some popular evaluation measures in future works. This can enhance the robustness of the proposed algorithm for different real world recognition and prediction issues.



---

*Source: 6058602-2022-07-12.xml*