A pointer instrument reading recognition method based on deep learning

Through deep learning technology, the pointer and scale features in the pointer meter are extracted, which solves the problems of poor recognition results and readings in extreme environments in the existing technology, and achieves efficient and automated pointer meter reading recognition.

CN118334351BActive Publication Date: 2024-08-30SHENZHEN AIKE CHUANGNENG SMART ENG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410749519.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-08-30
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

The existing pointer meter reading recognition method has poor ability to identify object contours, resulting in unsatisfactory pointer and scale extraction results. Moreover, the reading accuracy and efficiency are low in extreme environments, and it is prone to missed detections and wrong detections.

Method used

A pointer meter reading recognition method based on deep learning is used to preprocess the original image to construct a finger scale extraction network model. The hybrid atrous convolution attention block and multi-scale feature map fusion module are used to extract pointer and scale features, and the pointer and scale features are extracted through automatic The adaptive feature extraction module reduces the impact of deformation and achieves automated recognition.

Benefits of technology

It improves the recognition accuracy and efficiency of pointers and scales in pointer instruments, reduces the reliance on manual reading, enhances data collection capabilities in extreme environments, and reduces the rate of missed detections and false detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334351B
    Figure CN118334351B
Patent Text Reader

Abstract

The present invention discloses a pointer instrument reading recognition method based on deep learning, comprising: obtaining an original pointer instrument image and preprocessing it to obtain a processed pointer instrument data set; constructing an initial finger-scale extraction network model, training the finger-scale extraction network model based on the processed pointer instrument data set to obtain a target finger-scale extraction network model; recognizing the pointer instrument image to be recognized based on the trained finger-scale extraction network model to obtain an image recognition result of a pointer and scale instrument without background. The present invention adopts deep learning machine vision technology to replace manual reading, which not only improves the safety of the workplace and reduces the consumption of human resources, but also improves efficiency and accuracy through the automated data collection process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image recognition, and in particular relates to a pointer instrument reading recognition method based on deep learning. Background Art

[0002] Existing digital alternatives have high applicability. Pointer instruments without computer access have become a widely accepted option due to their low cost, high reliability, superior resistance to external interference and simple structural design. Pointer instruments are composed of two main components: instruments and pointers. They are widely used in many industries, such as power systems, manufacturing industries, and aerospace industries, for their simple structure, low-cost design, high anti-interference function and excellent reliability. The traditional method of reading data using regular and irregular manual monitoring of pointer measuring instruments is not only inefficient and inaccurate, but also consumes a lot of human resources. Moreover, it is difficult to manually read pointer instruments in extreme conditions such as radiation, high temperature and high pressure.

[0003] Therefore, the current pointer instrument reading recognition method has the following problems:

[0004] (1) The ability to recognize the contours of objects is poor, resulting in unsatisfactory segmentation and extraction of pointers and scales.

[0005] (2) Insufficient ability to obtain image information of pointer instruments.

[0006] (3) On the one hand, the pointers and scales in pointer instruments are small target objects. On the other hand, the instruments will be deformed to varying degrees due to long-term use. As a result, the current pointer instrument reading recognition method will result in a large number of missed detections and false detections. Summary of the invention

[0007] In order to solve the above technical problems, the present invention provides a pointer instrument reading recognition method based on deep learning, comprising:

[0008] Acquire the original pointer instrument image and perform preprocessing to obtain a processed pointer instrument data set;

[0009] Constructing an initial finger-and-scale extraction network model, and training the finger-and-scale extraction network model based on the processed pointer instrument data set to obtain a target finger-and-scale extraction network model;

[0010] Based on the trained finger-scale extraction network model, the pointer instrument image to be identified is identified to obtain an image recognition result of a pointer and scale instrument without background.

[0011] Preferably, the process of obtaining the original pointer instrument image and preprocessing it includes:

[0012] Install a camera at the front end of the pointer instrument, and obtain an original pointer instrument image based on the camera;

[0013] Manually annotating the original pointer instrument image to obtain a pointer instrument segmentation data set;

[0014] The JSON file generated by the pointer instrument segmentation dataset is converted into a semantic segmentation dataset, and the RGB color labels in the pointer instrument segmentation dataset are converted into corresponding single-channel digital labels of pointer instruments. The pointer instrument single-channel digital labels and the original pointer instrument images are then cropped to obtain the pointer instrument single-channel digital labels and the RGB remote sensing image dataset corresponding to the pointer instrument single-channel digital labels.

[0015] Preferably, the process of identifying the pointer instrument image to be identified based on the trained finger scale extraction network model includes:

[0016] Extracting the features of the pointer instrument image based on the pointer instrument feature extraction module;

[0017] Extract multi-scale pointer instrument image features based on multi-scale feature map fusion module;

[0018] The spatial structure of the original pointer instrument image is restored based on the pointer instrument adaptive feature extraction module.

[0019] Preferably, the process of extracting the features of the pointer instrument image based on the pointer instrument feature extraction module includes:

[0020] The original pointer instrument image Y with a pixel size of 512×512 and 3 channels is input into the pointer instrument feature extraction module, and a convolution operation is first performed by a convolution kernel with a size of 1×1 to obtain a shallow pointer instrument feature map F1 with a pixel size of 256×256 and 32 channels;

[0021] The shallow pointer instrument feature map F1 is input into the first mixed hole convolution attention block MDCA Block and the pointer instrument adaptive feature extraction module for processing to obtain a middle-level pointer instrument feature map F2 with a pixel size of 128×128 and 64 channels;

[0022] Input the middle-layer pointer instrument feature map F2 into the second mixed void convolution attention block MDCA Block and the pointer instrument adaptive feature extraction module for processing to obtain the void activation feature map R2;

[0023] The hole activation feature map R2 is input into the DECA attention module of the second mixed hole convolution attention block MDCA Block for processing to obtain a deep pointer instrument feature map F3 with a pixel size of 64×64 and 128 channels, and then the deep pointer instrument feature map F3 is input into the multi-scale feature map fusion module.

[0024] Preferably, the process of inputting the shallow pointer instrument feature map F1 into the first mixed hole convolution attention block MDCABlock and the pointer instrument adaptive feature extraction module includes:

[0025] The shallow pointer instrument feature map F1 is input into the mixed dilated convolution attention block MDCA Block, first processed by a convolution kernel of size 3×3 and dilation rate 1, and then enters the normalization and ReLU activation function layer;

[0026] Then enter the convolution kernel processing layer with a size of 3×3 and a void ratio of 2, and the normalization and ReLU activation function layer;

[0027] Then enter the convolution kernel processing layer with a size of 3×3 and a void ratio of 3, and the normalization and ReLU activation function layer;

[0028] Finally, after a 3×3 convolution operation, the hole activation feature map R1 is obtained and enters the DECA attention module, through which the global information of the pointer instrument image data is captured.

[0029] Preferably, the process of capturing global information of pointer instrument image data by the DECA attention module includes:

[0030] The hole activation feature map R1 entering the DECA attention module is used as input in the spatial dimension. The average pooling and the maximum pooling are used in parallel to compress the spatial features and obtain a one-dimensional vector of length C.

[0031] Perform one-dimensional convolution on the one-dimensional vector, and obtain the weight ω of each channel through the Sigmoid activation function, and multiply the weight ω with the original feature map F to obtain the feature map ; The formula expression is:

[0032]

[0033] Where: represents global average pooling, represents maximum pooling; represents a convolution operation with a filter size of 3×3, Indicates that the convolution kernel size is One-dimensional convolution of Represents the Sigmoid activation function; represents element-wise product;

[0034] in The size of the one-dimensional convolution kernel The calculation formula is:

[0035]

[0036] Where: express The closest odd number to Indicates the number of channels of output features, and These are all hyperparameters.

[0037] Preferably, the process of extracting multi-scale pointer instrument image features based on the multi-scale feature map fusion module includes:

[0038] Perform a 1×1 convolution operation on the deep pointer instrument feature map F3 to obtain a feature map M1, a feature map M2 with a hole rate of 12, and a feature map M3 with a hole rate of 24;

[0039] The feature map M1, the feature map M2 and the feature map M3 are spliced ​​in the channel dimension to obtain a multi-feature fusion feature map M4 with large-scale global information and small-scale local detail information; wherein the pixel size of the feature map M1, the feature map M2 and the feature map M3 is 64×64, 128 channels; the pixel size of the multi-feature fusion feature map M4 is 64×64, 128×3 channels;

[0040] After the multi-feature fusion feature map M4 is subjected to 3×3 convolution, the pixel size of the multi-feature fusion feature map M4 is consistent with the middle-layer pointer instrument feature map F2, and a multi-scale feature map F4 with a pixel size of 128×128 and 128 channels is obtained, and the multi-scale feature map F4 is input into the pointer instrument adaptive feature extraction module.

[0041] Preferably, the process of restoring the original pointer instrument image spatial structure based on the pointer instrument adaptive feature extraction module includes:

[0042] Connect the multi-scale feature map F4 with the middle-level pointer instrument feature map F2, wherein the middle-level pointer instrument feature map F2 adjusts the channels of the feature map to 128 through a 1×1 convolution to obtain a pointer instrument feature map F5;

[0043] The pointer instrument feature map F5 is concatenated with the pointer instrument feature map F4 in the channel dimension through a 1×1 convolution operation to obtain a pointer instrument feature map F6;

[0044] The pointer instrument feature map F6 is resized to be the same as the pixel size of the shallow pointer instrument feature map F1 by bilinear reshaping, so as to obtain a pointer instrument feature map F7 with a pixel size of 256×256 and 128 channels;

[0045] The shallow pointer instrument feature map F1 adjusts the channels of the feature map to 128 through 1×1 convolution to obtain a pointer instrument feature map F8, and then the pointer instrument feature map F8 is connected and 1×1 convolved with the pointer instrument feature map F7 to obtain a pointer instrument feature map F9 with a size of 256×256 and 256 channels;

[0046] The pointer instrument feature map F9 is input into the self-adjusting convolution layer to extract the features of the irregular pointer and scale shape, and then after 1×1 convolution and bilinear reshaping, the final finger scale extraction result with 1 channel and 512×512 pixel size is output.

[0047] Preferably, the process of inputting the pointer instrument feature map F9 into the self-adjusting convolution layer for processing comprises:

[0048] The pointer instrument feature map F9 obtains the position offset through the normal convolution layer, and then modulates the offset and amplitude of the features learned from each sampling point; finally, the geometric transformation feature learning process is performed, and the calculation is:

[0049]

[0050] In the formula and denote the learnable offset and weight scalar at position k, respectively, is the weight at k, is the input feature map, is the output feature map, Represents each position L on the output feature map y, Indicates the position offset of an element in the convolution kernel K; represents the modulation scalar at position k in the range [0, 1] and performs the calculation of the offset value using bilinear interpolation; and Obtained by applying convolution to the same input feature layer; the number of output channels is 3K, K represents the convolution kernel size, and the first 2K dimensions represent the f and y offsets at each position , the subsequent K dimension is used to obtain the weight of each position according to the sigmoid layer .

[0051] Compared with the prior art, the present invention has the following advantages and technical effects:

[0052] (1) The present invention installs a camera at the front end of the pointer instrument, and uses a deep learning model to automatically learn the features of the pointer and scale in the pointer instrument from a large amount of pointer instrument image data, and can realize the extraction of the pointer and scale in the pointer instrument. The extracted image is processed and the formula is calculated to automatically read the instrument. Subsequently, the employee in charge of the post can remotely monitor the employee in the post in real time through a computer or mobile phone. This simple method replaces the cumbersome manual reading procedure, reduces the consumption of human resources, and increases the efficiency and accuracy of data collection.

[0053] (2) The pointer meter feature extraction module in the new finger ruler extraction network MMD-Net (Meter Measurement Dial-Network) designed by the present invention can enable the segmentation and extraction model to obtain richer feature information in the shallow network, improve the capture range of the receptive field and the discriminability of objects of different sizes and shapes, and improve the model's ability to recognize object contours.

[0054] (3) The multi-scale feature map fusion module in the MMD-Net of the present invention can fuse three different feature map scales, thereby improving the network's ability to obtain multi-scale information and obtaining large-scale global information and small-scale local detail information.

[0055] (4) The pointer instrument adaptive feature extraction module in the MMD-Net of the present invention can adaptively adjust according to the deformation of the object in the image, effectively extract features from objects with different shapes and directions, and reduce the occurrence of missed detection and false detection when extracting the pointer and scale in the needle instrument. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0057] Figure 1 It is a schematic diagram of the structure of the MMD-Net network model of an embodiment of the present invention;

[0058] Figure 2 It is a MMD-Net network flow chart of an embodiment of the present invention;

[0059] Figure 3 A schematic diagram of a method flow of an embodiment of the present invention;

[0060] Figure 4 It is a structural schematic diagram of a pointer instrument feature extraction module according to an embodiment of the present invention;

[0061] Figure 5It is a schematic diagram of the structure of the first hybrid dilated convolutional attention block MDCA Block in an embodiment of the present invention;

[0062] Figure 6 It is a schematic diagram of the structure of the DECA attention module in the first MDCA Block of an embodiment of the present invention;

[0063] Figure 7 It is a schematic diagram of the structure of the second hybrid dilated convolutional attention block MDCA Block in an embodiment of the present invention;

[0064] Figure 8 It is a schematic diagram of the structure of the DECA attention module in the second MDCA Block of an embodiment of the present invention;

[0065] Fig. 9 Schematic diagram of the structure of a multi-scale feature map fusion module according to an embodiment of the present invention;

[0066] Fig.10 It is a structural schematic diagram of a pointer instrument adaptive feature extraction module according to an embodiment of the present invention;

[0067] Fig.11 This is a diagram showing the effect of sampling pixel by pixel inward from the circumference of an embodiment of the present invention;

[0068] Fig.12 Schematic diagram of a rectangular image of an instrument dial according to an embodiment of the present invention. DETAILED DESCRIPTION

[0069] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0070] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0071] like Figure 1-3 As shown, this embodiment provides a pointer instrument reading recognition method based on deep learning, including:

[0072] Acquire the original pointer instrument image and perform preprocessing to obtain a processed pointer instrument data set;

[0073] Constructing an initial finger-and-scale extraction network model, and training the finger-and-scale extraction network model based on the processed pointer instrument data set to obtain a target finger-and-scale extraction network model;

[0074] Based on the trained finger-scale extraction network model, the pointer instrument image to be identified is identified to obtain an image recognition result of a pointer and scale instrument without background.

[0075] Further, Step 1: preprocessing pointer instrument dataset;

[0076] Install a camera at the front end of the pointer instrument to collect pointer instrument image data. After acquiring the data, use Labelme to manually annotate the image and generate a pointer instrument segmentation dataset. Since the binary semantic segmentation label is usually single-channel, the label value of each pixel can be one of the two categories. For example, in the image segmentation task, 0 and 1 are usually used to represent the two categories. Therefore, for the binary semantic segmentation task, the label image only needs one channel to represent the category of the pixel.

[0077] After the labeling is completed in this embodiment, the labelme2voc script is used to batch convert the JSON files generated after the labeling is completed into a semantic segmentation dataset, and the RGB color labels in the pointer instrument segmentation dataset are converted into corresponding single-channel digital labels of the pointer instrument, and 3,000 single-channel digital labels of the pointer instrument are obtained. Then, the opencv library in python is used to crop the single-channel digital labels and the original images to a size of 512×512 pixels. The final dataset includes 3,000 single-channel digital labels of pointer instruments and 3,000 corresponding RGB remote sensing image datasets taken from the camera.

[0078] Further, Step 2: construct the finger scale extraction network MMD-Net;

[0079] The present invention uses a finger scale extraction network MMD-Net based on deep learning to extract pointers and scales from pointer instrument images. There are three main steps: extracting pointer instrument image features; extracting multi-scale pointer instrument image features; and restoring the original pointer instrument image spatial structure. The three main steps correspond to the three modules of the MMD-Net network model: pointer instrument feature extraction module; multi-scale feature map fusion module; pointer instrument adaptive feature extraction module. Among them, the multi-scale pointer instrument image features extracted by the multi-scale feature map fusion module are a kind of feature information. Since the void ratio of the void convolution is different, the feature information obtained by the feature map after the void convolution with different void ratios is also different.

[0080] The present invention can enable the segmentation and extraction model to obtain richer feature information in a shallow network through a pointer instrument feature extraction module, improve the capture range of the receptive field and the discernibility of objects of different sizes and shapes, and improve the model's ability to recognize object contours; through a multi-scale feature map fusion module, three different feature map scales can be fused, thereby improving the network's ability to obtain multi-scale information; through a pointer instrument adaptive feature extraction module, adaptive adjustment can be made according to the deformation of objects in the image, and features can be effectively extracted from objects of different shapes and directions, reducing the occurrence of missed detection and wrong detection when extracting pointers and scales in needle instruments.

[0081] Furthermore, Step 2.1 extracts the features of the pointer instrument image;

[0082] like Figure 4 As shown in the figure, the pointer instrument image feature extraction module of MMD-Net is used to extract the pointer instrument feature. The operation and construction process of the pointer instrument feature extraction module is as follows:

[0083] Step 2.1.1: After the original pointer instrument image Y with a pixel size of 512×512 and 3 channels is input into the pointer instrument feature extraction module, a convolution operation is first performed by a convolution kernel with a size of 1×1 to obtain a shallow pointer instrument feature map F1 with a pixel size of 256×256 and 32 channels. Then F1 is input into the first mixed void convolution attention block MDCA Block and the pointer instrument adaptive feature extraction module.

[0084] Step 2.1.2: The shallow pointer instrument feature map F1 is input into the mixed void convolution attention block MDCA Block, where the structure of the mixed void convolution attention block MDCA Block is as follows: Figure 5 shown.

[0085] The shallow pointer instrument feature map F1 is added to the mixed dilated convolution attention block MDCA Block. It first enters the convolution kernel processing with a size of 3×3 and a dilation rate of 1, then enters the normalization and ReLU activation function layer, then enters the convolution kernel processing layer with a size of 3×3 and a dilation rate of 2, normalization and ReLU activation function layer, then enters the convolution kernel processing layer with a size of 3×3 and a dilation rate of 3, normalization and ReLU activation function layer, and finally enters the convolution kernel processing layer with a size of 3×3 and a dilation rate of 3, normalization and ReLU activation function layer. Finally, after a 3×3 convolution operation, the dilated activation feature map R1 is obtained and enters the DECA (Dilated Effective Channel Attention) attention module.

[0086] It should be noted that the ordinary convolution operation calculates the pixel value of the corresponding position of the output feature map by multiplying the convolution kernel with each pixel point of the input feature map and summing them. The dilated convolution inserts additional intervals or "holes" in the convolution kernel. These intervals can increase the effective size of the convolution kernel without increasing the number of parameters. The size of this interval is called the "dilation rate", which is usually expressed as an integer and determines the size of the interval in the convolution kernel.

[0087] Step 2.1.3: The DECA attention module in the mixed dilated convolutional attention block MDCA Block can capture the global information of the pointer instrument image data. The structure of the DECA attention module is as follows: Figure 6 As shown:

[0088] Enter the feature map of the DECA attention module, the hole activation feature map R1 is used as input, and the spatial feature is first compressed, that is, two parallel poolings are used in the spatial dimension, average pooling (Average Pooling, Avg pool) and maximum pooling (Max Pooling, Max pool), to obtain a one-dimensional vector of length C, and then the obtained one-dimensional vector is subjected to a one-dimensional convolution, and the weight ω of each channel is obtained through the Sigmoid activation function, and finally the weight ω is multiplied by the original feature map F to obtain the feature map The process is shown in the following formula (1):

[0089] (1)

[0090] Where: represents global average pooling, represents maximum pooling; represents a convolution operation with a filter size of 3×3, Indicates that the convolution kernel size is One-dimensional convolution of Represents the Sigmoid activation function; represents the element-wise product. The size of the one-dimensional convolution kernel It can be determined adaptively by the following formula (2).

[0091] (2)

[0092] Where: express The closest odd number to Indicates the number of channels of output features, and These are all hyperparameters.

[0093] Step 2.1.4: After the first MDCA Block processes the shallow pointer instrument feature map F1, it obtains the middle pointer instrument feature map F2 with a pixel size of 128×128 and 64 channels, and sends it to the second mixed void convolution attention block MDCA Block and the pointer instrument adaptive feature extraction module.

[0094] Step 2.1.5: The second MDCA Block is similar to the first MDCA Block. Figure 7 As shown, after obtaining the hole activation feature map R2, it is input into the DECA attention module of the second MDCA Block, as Figure 8 After processing, a deep pointer instrument feature map F3 with a pixel size of 64×64 and 128 channels is obtained, and then the deep pointer instrument feature map F3 is input into the multi-scale feature map fusion module.

[0095] Furthermore, Step 2.2 extracts multi-scale pointer instrument image features;

[0096] like Fig. 9 As shown in Figure 1, the extraction of multi-scale pointer instrument image features is completed by the multi-scale feature map fusion module of MMD-Net.

[0097] Step 2.2.1: The deep pointer instrument feature map F3 input from the pointer instrument feature extraction module to the multi-scale feature map fusion module is subjected to a 1×1 convolution operation to obtain the feature map M1 with a hole rate of 12, the feature map M2 with a hole rate of 24, and the feature map M3;

[0098] The feature map M1, the feature map M2 and the feature map M3 are spliced ​​in the channel dimension to obtain a multi-feature fusion feature map M4 with large-scale global information and small-scale local detail information; wherein the pixel size of the feature map M1, the feature map M2 and the feature map M3 is 64×64, 128 channels;

[0099] Step 2.2.2: The fused multi-feature fusion feature map M4 has a pixel size of 64×64 and 128×3 channels. After 1×1 convolution, the number of channels of the spliced ​​feature map is compressed to 128.

[0100] Step 2.2.3: Finally, after 3×3 convolution, the pixel size of the multi-feature fusion feature map M4 is consistent with the middle-level pointer instrument feature map F2, which is convenient for the fusion operation with F2 in the pointer instrument adaptive feature extraction module. After 3×3 convolution, the result of the multi-scale feature map fusion module is obtained, that is, the multi-scale feature map F4 with a pixel size of 128×128 and 128 channels, and it is input into the pointer instrument adaptive feature extraction module.

[0101] Furthermore, Step 2.3 restores the original pointer instrument image spatial structure;

[0102] like Fig.10 As shown in the figure, the restoration of the original pointer instrument image spatial structure is completed by the pointer instrument adaptive feature extraction module of MMD-Net. The operation and construction process of the pointer instrument feature extraction module is as follows:

[0103] Step 2.3.1: The multi-scale feature map F4 generated by the multi-scale feature map fusion module is connected to the middle-level pointer instrument feature map F2 output by the pointer instrument feature extraction module. The middle-level pointer instrument feature map F2 adjusts the channel of the feature map to 128 through 1×1 convolution to obtain the pointer instrument feature map F5. F5 and F4 are spliced ​​in the channel dimension through 1×1 convolution operation to obtain the pointer instrument feature map F6.

[0104] Step 2.3.2: The pointer instrument feature map F6 is resized to the same pixel size as the shallow pointer instrument feature map F1 by bilinear reshaping, and the pointer instrument feature map F7 with a pixel size of 256×256 and 128 channels is obtained;

[0105] The shallow pointer instrument feature map F1 adjusts the feature map channel to 128 through 1×1 convolution to obtain the pointer instrument feature map F8, and then the pointer instrument feature map F8 and the pointer instrument feature map F7 perform a connection operation (expressed as CONCAT) and a 1×1 convolution (expressed as CONV1×1) to obtain a pointer instrument feature map F9 with a size of 256×256 and 256 channels. So far, multi-layer image features and multi-scale feature map features have been extracted.

[0106] Step 2.3.3: The pointer instrument feature map F9 is input into the Self-Adjusting Convolution (SAC) layer to extract the features of the irregular pointer and scale shape. The number of channels of the output feature map is the same as the input feature map. Finally, after 1×1 convolution and bilinear reshaping, the output of 1 channel and 512×512 pixel size is the final finger scale extraction result, which is the semantic segmentation image of the pointer and scale in the instrument pointer.

[0107] The process of inputting the pointer instrument feature map F9 into the self-adjusting convolution layer for processing includes:

[0108] First, the position offset is obtained through the normal convolution layer, and then the offset and amplitude of the features learned from each sampling point are modulated. Finally, the geometric transformation feature learning process is performed, which is calculated as:

[0109] (3)

[0110] In the formula and denote the learnable offset and weight scalar at position k, respectively, is the weight at k, is the input feature map, is the output feature map, Represents each position on the output feature map y , Represents the position offset of an element in the convolution kernel K. represents the modulation scalar at position k in the range [0, 1] and performs the calculation of the offset value using bilinear interpolation. and It can be obtained by applying convolution to the same input feature layer. The number of output channels is 3K, where K represents the convolution kernel size. The first 2K dimensions represent the f and y offsets at each position ( ), the subsequent K dimension is used to obtain the weight of each position according to the sigmoid layer ( ).

[0111] It should be noted that bilinear interpolation is a method of estimating new data points between discrete data points, especially in two-dimensional space. This interpolation method assumes that there is a linear relationship between each adjacent data point. Bilinear interpolation is often used in image processing and computer graphics to estimate new pixel values ​​between discrete pixel points on an image in order to perform operations such as image enlargement, reduction or deformation.

[0112] Bilinear reshaping allows you to enlarge or reduce an image without changing its resolution. This technique is widely used in digital image processing, computer vision, and graphics, such as image scaling in image editing software and texture mapping in game development.

[0113] A normal 2D convolution consists of two steps:

[0114] (1) Input feature map with normal convolution kernel K Take samples.

[0115] (2) Sum the weighted sample values ​​of w. For each position p on the output feature map y, Represents the position offset of an element in the convolution kernel K.

[0116]

[0117] Further optimization scheme, Step 2 implementation example: Input size is 512×512 pixels, 3 channels of original pointer instrument feature map:

[0118] After the original pointer instrument image with a pixel size of 512×512 and 3 channels is input into the pointer instrument feature extraction module, a convolution operation is first performed by a convolution kernel with a size of 1×1 to obtain a shallow pointer instrument feature map F1 with a pixel size of 256×25 and 32 channels. Then, the first MDCA Block processes the shallow pointer instrument feature map F1 to obtain a middle pointer instrument feature map F2 with a pixel size of 128×128 and 64 channels, which is then sent to the second mixed void convolution attention block MDCA Block to obtain a deep feature map F3 with a pixel size of 64×64 and 128 channels. F3 is input into the multi-scale feature map fusion module. The feature map M1 with a pixel size of 64×64 and 128 channels obtained by the 1×1 convolution operation and the results of the two dilation rates of 12 and 24, M2 (64×64 pixels, 128 channels) and M3 (64×64 pixels, 128 channels), are concat fused into a multi-feature fusion feature map M4 (64×64 pixels, 128×3 channels). After 1×1 convolution, the number of channels of the concatenated feature map is compressed to 128. After 3×3 convolution, the size becomes a multi-scale feature map F4 with a pixel size of 128×128 and 128 channels. After entering the stage of pointer instrument adaptive feature extraction, the middle-level pointer instrument feature map F2 is concat fused with a pixel size of 128×128 and 128 channels. The pointer instrument feature map F5 with a pixel size of 128×128 and 128 channels is obtained. F5 and F4 are concat and 1×1 convolution operation to obtain the pointer instrument feature map F6 with a pixel size of 128×128 and 128 channels. The pointer instrument feature map F6 is resized to 256×256 pixels and 128 channels through RESHAPE. The shallow pointer instrument feature map F1 adjusts the channels of the feature map to 128 through 1×1 convolution to obtain a pointer instrument feature map F8 with a pixel size of 256×256 and 128 channels. Then the pointer instrument feature map F8 and the pointer instrument feature map F7 are connected (expressed as CONCAT) and 1×1 convolution (expressed as CONV1×1) to obtain a pointer instrument feature map F9 with a size of 256×256 and 128 channels. The pointer instrument feature map F9 is input into the Self-Adjusting Convolution (SAC) layer. After 1×1 convolution and bilinear reshaping, a semantic segmentation image of the pointer and scale in the instrument pointer with a size of 1 channel and 512×512 pixels is output.

[0119] Further, Step 3: division of pointer instrument data set;

[0120] The pointer instrument data set preprocessed in Step 1 is divided into a training set, a validation set, and a test set according to a certain ratio. The training set, the validation set, and the test set are mutually exclusive data. The training set accounts for 70% of the total data set, that is, 2100 pointer instrument images. The validation set and the test set each account for 15% of the total data set, that is, 450 pointer instrument images respectively. In this embodiment, the data set division ratio (training set: validation set: test set) is 70%:15%:15%.

[0121] Step 4: Model training and verification

[0122] Based on the finger scale extraction network MMD-Net model constructed in Step 2, train and update the parameters of each layer. First, initialize all neural network parameters and set model-related hyperparameters, such as training rounds, batch size, optimizer selection, learning rate, maximum value of gradient clipping strategy, etc.

[0123] Embodiment: The finger scale extraction network MMD-Net is trained, and the whole training process is 100 epochs. The weight decay coefficient is set to 0.05, the learning rate is set to 0.0000001, the batch size is set to 4, the number of iterations in the first 50 epochs is 217, the number of iterations in the second 50 epochs is 292, and the total number of iterations is 25450. Mosaic data enhancement is enabled in each round, and the resolution of the input image is uniformly adjusted to 512×512 format. After initializing the parameters, the pointer instrument training set and pointer instrument validation set data processed by Step 1 are divided into multiple batches, and each batch of pointer instrument training set data is input into MMD-Net for training to obtain the training loss value loss of the batch. After completing a round of training for all batches of data in the entire pointer instrument training set (in the actual training process, there may be multiple rounds), the pointer instrument validation set is input into IDR-Net in batches to obtain the corresponding batch loss value batch_loss. During training and verification, MMD-Net will automatically learn and adjust parameters according to each loss and batch_loss. When the training process is completed for one or more rounds until the batch_loss value converges, the MMD-Net model training is completed.

[0124] Step 5: Apply the MMD-Net algorithm model to extract the pointer and scale in the pointer instrument;

[0125] After the finger and scale extraction network MMD-Net model is trained, the model is used to automatically extract the pointer and scale in the pointer instrument.

[0126] In practical applications, the pointer instrument data collected by the camera is input, the pointer instrument data set is preprocessed and input into the MMD-Net finger and scale extraction network model, and the extraction result of the pointer instrument is output, that is, the background interference is removed and only the pointer and scale finger and scale extraction image are retained.

[0127] Step 6: Use the dimension reduction finger-rule distance method to read the finger-rule extraction image extracted by MMD-Net;

[0128] The reduced dimension finger-ruler distance method is used to extract the specific value of the finger-ruler map. This method relies on the distance between the pointer and the adjacent scale line. The reduced dimension finger-ruler distance method calculates the reading by measuring the ratio of the sum of the distances between the pixels on the two scale lines to the straight line of the pointer. The specific steps are as follows:

[0129] Step 6.1: Convert the pointer instrument extraction result (finger scale extraction image), that is, the circular instrument dial, into a rectangular image. This step is achieved by sampling the circumference pixel by pixel inward, so that the scale and pointer can be processed and analyzed more easily.

[0130] The step of sampling the circumference inward pixel by pixel is as follows: find the center and radius of the circular dial. This embodiment uses the Hough circle transform to find the center and radius of the circular dial, divide each circumference of the circular dial into equal parts, and create a series of concentric circles. Sampling is performed by gradually reducing the radius from the outside to the inside. Specifically, starting from the initial sampling point of the concentric circle, the pixel values ​​at the edge of each concentric circle are uniformly sampled in a clockwise direction. Using the center of the initial concentric circle as the midpoint, the radius is shortened by one pixel unit to generate new concentric circles. The pixel values ​​on multiple concentric circles can be obtained. The width of the rectangular image is usually set to the length of the circumference, and the height is set to the number of concentric circles, that is, the number of circular rings from the outside to the inside. Uniformly distributed pixel points are selected from each concentric circle and flattened into rows of the rectangular image in sequence. The effect is as follows: Fig.11 As shown:

[0131] Step 6.2: By converting the rectangular image into a one-dimensional array, the pixel values ​​of the two-dimensional image are added to the one-dimensional array one by one in the order of rows to locate the position of the pointer relative to the scale.

[0132] Step 6.3: Fig.12 As shown in , the scale range of the instrument is determined according to the number of scales of the instrument. Different instruments may have different numbers of scale lines, and the number of scales is determined by determining the scale number. Finally, as Fig.10 As shown, the initial scale information is recorded as S1, the end scale information is S2, the pointer distance is D, and the range is d. Then the scale result A can be obtained by the following formula:

[0133] (3)

[0134] It should be noted that Hough circle transform is a popular method for detecting circles. Hough circle transform is applied to detect circles in an image by searching for circles that meet specified parameters in the image, using methods such as Canny edge detection. The algorithm outputs the center coordinates and radius of each circle detected.

[0135] Example: If the pointer instrument is a weight scale, the scale is 0 to 60, and each adjacent scale corresponds to five pounds of actual weight. If the pointer points to the 45 position of the scale, according to the above formula, S1 is 0, S2 is 60, D is 300 (60×5=300), and d=45. The weight result A is 225 pounds.

[0136] The present invention extracts the pointer and scale from the pointer instrument image based on the deep learning finger scale extraction network MMD-Net, specifically designs a pointer instrument feature extraction module, and captures the deeper information of multi-scale objects through the mixed dilated convolution attention block MDCA Block, which is based on three serial dilated convolution kernels (the dilated rate is r = 1, 2, 3), and also includes an attention mechanism block DECA. The attention mechanism block DECA captures the global information of the pointer data, and can make full use of the effective information to further improve the capture range of the receptive field.

[0137] The multi-scale feature map fusion module in the MMD-Net of the present invention connects and fuses the feature map output by the 1×1 convolution and two dilated convolutions with dilated rates of 12 and 24. Large-scale global information and small-scale local detail information can be obtained simultaneously.

[0138] The pointer meter adaptive feature extraction module in the MMD-Net of the present invention achieves the effect of restoring the spatial structure of the original pointer meter image by resizing the multi-scale feature map input from the multi-scale feature map fusion module and fusing it with the output of the pointer meter feature extraction module. Then, the self-adjusting convolution (SAC) layer is input to extract the features of the irregular pointer and scale shape. The new finger scale extraction network MMD-Net designed by the present invention innovatively combines the output results of the modules behind the network with the output results of the front network, and designs a self-adjusting convolution (SAC) layer to reduce the influence of the pointer meter on the network due to different degrees of deformation. The pointer meter adaptive feature extraction module is designed in combination.

[0139] The present invention also proposes to read the finger scale extraction image through the dimension reduction finger scale distance method. Through the dimension reduction finger scale distance method of the present invention, the MMD-Net extraction result is subjected to final data recognition to obtain the final pointer instrument data. The dimension reduction finger scale distance method of the present invention can directly obtain the specific value of the finger scale extraction image. This method relies on the distance between the pointer and the adjacent scale line. The circular instrument dial is converted into a rectangular image by sampling pixel by pixel inward from the circumference, and then the rectangular image is converted into a one-dimensional array. The pixel values ​​of the two-dimensional image are added to the one-dimensional array one by one in the order of the rows, and the position of the pointer relative to the scale is located. The dimension reduction finger scale distance method calculates the reading by measuring the ratio of the sum of the distances between the pixel points on the two scale lines to the straight line of the pointer.

[0140] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A pointer instrument reading recognition method based on deep learning, characterized in that: include: Acquire the original pointer instrument image and perform preprocessing to obtain a processed pointer instrument data set; Constructing an initial finger-scale extraction network model, and training the initial finger-scale extraction network model based on the processed pointer instrument data set to obtain a target finger-scale extraction network model; Based on the trained target finger scale extraction network model, the image of the pointer instrument to be identified is identified to obtain the image recognition result of the pointer and scale instrument without background; The process of identifying the pointer instrument image to be identified based on the trained target finger scale extraction network model includes: Extracting the features of the pointer instrument image based on the pointer instrument feature extraction module; Extract multi-scale pointer instrument image features based on multi-scale feature map fusion module; Restore the original pointer instrument image spatial structure based on the pointer instrument adaptive feature extraction module; The process of extracting the features of the pointer instrument image based on the pointer instrument feature extraction module includes: The original pointer instrument image Y with a pixel size of 512×512 and 3 channels is input into the pointer instrument feature extraction module, and a convolution operation is first performed by a convolution kernel with a size of 1×1 to obtain a shallow pointer instrument feature map F1 with a pixel size of 256×256 and 32 channels; The shallow pointer instrument feature map F1 is input into the first mixed hole convolution attention block MDCA Block for processing to obtain a middle pointer instrument feature map F2 with a pixel size of 128×128 and 64 channels; The middle-layer pointer instrument feature map F2 is input into the second mixed hole convolution attention block MDCA Block for processing to obtain the hole activation feature map R2; The hole activation feature map R2 is input into the DECA attention module of the second mixed hole convolution attention block MDCA Block for processing to obtain a deep pointer instrument feature map F3 with a pixel size of 64×64 and 128 channels, and then the deep pointer instrument feature map F3 is input into the multi-scale feature map fusion module; The process of inputting the shallow pointer instrument feature map F1 into the first mixed dilated convolution attention block MDCA Block and the pointer instrument adaptive feature extraction module includes: The shallow pointer instrument feature map F1 is input into the mixed dilated convolution attention block MDCA Block, first processed by a convolution kernel of size 3×3 and dilation rate 1, and then enters the normalization and ReLU activation function layer; Then enter the convolution kernel processing layer with a size of 3×3 and a void ratio of 2, and the normalization and ReLU activation function layer; Then enter the convolution kernel processing layer with a size of 3×3 and a void ratio of 3, and the normalization and ReLU activation function layer; Finally, after a 3×3 convolution operation, the hole activation feature map R1 is obtained and enters the DECA attention module, through which the global information of the pointer instrument image data is captured; The process of capturing the global information of the pointer instrument image data through the DECA attention module includes: The hole activation feature map R1 entering the DECA attention module is used as input in the spatial dimension. The average pooling and the maximum pooling are used in parallel to compress the spatial features and obtain a one-dimensional vector of length C. Perform one-dimensional convolution on the one-dimensional vector, and obtain the weight ω of each channel through the Sigmoid activation function, and multiply the weight ω with the original feature map F to obtain the feature map ; The formula expression is: Where: represents global average pooling, represents maximum pooling; represents a convolution operation with a filter size of 3×3, Indicates that the convolution kernel size is One-dimensional convolution of Represents the Sigmoid activation function; represents element-wise product; in The size of the one-dimensional convolution kernel The calculation formula is: Where: express The closest odd number to Indicates the number of channels of output features, and These are all hyperparameters; The process of extracting multi-scale pointer instrument image features based on the multi-scale feature map fusion module includes: Perform a 1×1 convolution operation on the deep pointer instrument feature map F3 to obtain a feature map M1, a feature map M2 with a hole rate of 12, and a feature map M3 with a hole rate of 24; The feature map M1, the feature map M2 and the feature map M3 are spliced ​​in the channel dimension to obtain a multi-feature fusion feature map M4 with large-scale global information and small-scale local detail information; wherein the pixel size of the feature map M1, the feature map M2 and the feature map M3 is 64×64, 128 channels; the pixel size of the multi-feature fusion feature map M4 is 64×64, 128×3 channels; After the multi-feature fusion feature map M4 is subjected to 3×3 convolution, the pixel size of the multi-feature fusion feature map M4 is consistent with the middle-layer pointer instrument feature map F2, and a multi-scale feature map F4 with a pixel size of 128×128 and 128 channels is obtained, and the multi-scale feature map F4 is input into the pointer instrument adaptive feature extraction module; The process of restoring the original pointer instrument image spatial structure based on the pointer instrument adaptive feature extraction module includes: Connecting the multi-scale feature map F4 with the middle-level pointer instrument feature map F2, including adjusting the channels of the feature map to 128 through 1×1 convolution of the middle-level pointer instrument feature map F2, to obtain a pointer instrument feature map F5; The pointer instrument feature map F5 is concatenated with the multi-scale feature map F4 in the channel dimension through a 1×1 convolution operation to obtain a pointer instrument feature map F6; The pointer instrument feature map F6 is resized to be the same as the pixel size of the shallow pointer instrument feature map F1 by bilinear reshaping, so as to obtain a pointer instrument feature map F7 with a pixel size of 256×256 and 128 channels; The shallow pointer instrument feature map F1 adjusts the channels of the feature map to 128 through 1×1 convolution to obtain a pointer instrument feature map F8, and then the pointer instrument feature map F8 is connected and 1×1 convolved with the pointer instrument feature map F7 to obtain a pointer instrument feature map F9 with a size of 256×256 and 256 channels; The pointer instrument feature map F9 is input into the self-adjusting convolution layer to extract the features of the irregular pointer and scale shape, and then after 1×1 convolution and bilinear reshaping, the final finger scale extraction result with 1 channel and 512×512 pixel size is output; The process of inputting the pointer instrument feature map F9 into the self-adjusting convolution layer for processing includes: The pointer instrument feature map F9 obtains the position offset through the normal convolution layer, and then modulates the offset and amplitude of the features learned from each sampling point; finally, the geometric transformation feature learning process is performed, and the calculation is: In the formula and denote the learnable offset and weight scalar at position k, respectively, is the weight at k, is the input feature map, is the output feature map, Represents each position L on the output feature map y, Indicates the position offset of an element in the convolution kernel K; represents the modulation scalar at position k in the range [0, 1] and performs the calculation of the offset value using bilinear interpolation; and Obtained by applying convolution to the same input feature layer; the number of output channels is 3K, K represents the convolution kernel size, and the first 2K dimensions represent the f and y offsets at each position , the subsequent K dimension is used to obtain the weight of each position according to the sigmoid layer .

2. The method for identifying pointer instrument readings based on deep learning according to claim 1, characterized in that: The process of obtaining the original pointer instrument image and preprocessing it includes: Install a camera at the front end of the pointer instrument, and obtain an original pointer instrument image based on the camera; Manually annotating the original pointer instrument image to obtain a pointer instrument segmentation data set; The JSON file generated by the pointer instrument segmentation dataset is converted into a semantic segmentation dataset, and the RGB color labels in the pointer instrument segmentation dataset are converted into corresponding single-channel digital labels of pointer instruments. The pointer instrument single-channel digital labels and the original pointer instrument images are then cropped to obtain the pointer instrument single-channel digital labels and the RGB remote sensing image dataset corresponding to the pointer instrument single-channel digital labels.

Citation Information

Patent Citations

  • Reading identification method for pointer type instrument

    CN117636325A