Pointer type pressure gauge reading method based on hierarchical parallel network
By adopting a hierarchical parallel network in pointer dashboard readings, improving the OCR segmentation network and adding regional classification and global context vector enhancement modules, the problem of low reading efficiency and accuracy in the prior art is solved, and higher reading accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411834284.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing pointer dashboard reading method based on deep learning has problems such as low efficiency and accuracy, safety risks, and limited segmentation effects due to light and shadow effects.
The pointer pressure gauge reading method based on a hierarchical parallel network is adopted. By improving the OCR segmentation network, the region classification module and the global context vector enhancement module are added to form a hierarchical parallel network, which is used to train the image defuzzy model and perform reading recognition of pointer scales.
Improve the accuracy and stability of pointer-based instrument panel readings based on deep learning, reduce the impact of light and shadow, and enhance the segmentation performance of the model.
Smart Images

Figure CN119762780A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a pointer pressure gauge reading method based on a hierarchical parallel network. Background Art
[0002] With the advent of the era of artificial intelligence, machine vision technology and deep learning technology have been widely used in various fields. In the industrial field, pointer instruments have the advantages of simple structure, stable and reliable operation, low production cost, and the ability to work in harsh environments such as high temperature, high pressure and strong magnetic field, and play an important role in the industrial field. In order to solve the limitations of traditional manual readings, such as low efficiency and accuracy, high safety risks, etc., the pointer instrument panel reading algorithm based on deep learning has become a research hotspot.
[0003] In recent years, with the significant progress of deep learning technology, many solutions have tried to first use the detection model to capture the complete instrument image, and then separate the pointer and scale through image segmentation methods for accurate reading. However, this general idea is affected by lighting and shadows, resulting in limited segmentation effect and slow reading speed. In order to reduce the reading time, some solutions use target detection methods to directly read. However, due to the large difference in the scale of the pointer and the scale, and the different density and angle of the scale, horizontal box detection is prone to missed detection due to excessive IoU calculation, and there is also a lot of redundancy.
[0004] Currently, in the field of segmentation, there are two methods for calculating the readings of pointer-type instruments: the distance method and the angle method. The distance method reads the reading by calculating the relative position of the pointer, and the angle method derives the instrument reading based on the deflection angle of the pointer. The angle method is simpler and faster than the distance method, so more research has been done on the angle method. However, the basic principle of the angle method limits its applicability to instruments with uneven dial scales. Pointer-type instruments are mostly small targets, with the characteristics of a large number of segments and a small number of pixels. Directly applying the segmentation model may result in a large deviation between the edge pixels of the segmented pointer and scale line and the actual target edge, which in turn affects the accuracy and stability of the readings.
[0005] Therefore, in the related technology, there is an urgent need for a method that can improve the accuracy and stability of pointer instrument panel readings based on deep learning. Summary of the invention
[0006] Based on this, it is necessary to provide a pointer pressure gauge reading method based on a hierarchical parallel network, which can improve the accuracy and stability of pointer instrument panel readings based on deep learning, in response to the above technical problems.
[0007] In a first aspect, the present application provides a method for reading a pointer pressure gauge based on a hierarchical parallel network. The method comprises:
[0008] Acquire the pointer instrument image and perform preprocessing to obtain the pointer instrument data set;
[0009] Based on the OCR segmentation network, the regional classification module and the global context vector enhancement module are added to obtain a hierarchical parallel network.
[0010] Inputting the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model;
[0011] Inputting the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image;
[0012] The pointer scale reading is recognized based on the segmented image.
[0013] Optionally, in one embodiment of the present application, the preprocessing includes:
[0014] Annotating the pointer, scale, and background in the pointer instrument image;
[0015] Convert the format of the annotated pointer instrument image.
[0016] Optionally, in one embodiment of the present application, the structure of the hierarchical parallel network includes:
[0017] The backbone network performs semantic segmentation on the input image to obtain the initial category segmentation result and feature map;
[0018] The initial category segmentation result and the feature map are calculated by using a matrix multiplication method to obtain a category region representation;
[0019] A region classification module is used to classify the category region representation into a global context vector and a semantic category vector;
[0020] Using a global context enhancement module to enhance the global context vector and merge it with the semantic category vector;
[0021] The object context feature representation is determined based on the merged vector, and the enhanced feature map is obtained after feature concatenation with the feature map, which is used to predict the pixel semantic category to obtain a fine category segmentation result.
[0022] Optionally, in one embodiment of the present application, the area classification module includes:
[0023] Convert soft object regions into probability maps;
[0024] Performing coarse segmentation based on the probability map;
[0025] The coarse segmentation results of the entire image are statistically analyzed to obtain the semantic category vector and the global context vector.
[0026] Optionally, in one embodiment of the present application, the global context vector enhancement module includes:
[0027] The global context vector is enhanced by using global average pooling and channel average pooling respectively.
[0028] Optionally, in one embodiment of the present application, the identifying the reading of the pointer scale based on the segmented image includes:
[0029] Using an image erosion algorithm to erode the segmented image;
[0030] Expand the annular dial in the segmented image into a rectangle, and perform binarization and noise reduction processing;
[0031] Calculate the position of the pointer relative to each scale to get the reading result.
[0032] In a second aspect, the present application also provides a pointer-type pressure gauge reading device based on a hierarchical parallel network. The device comprises:
[0033] The data acquisition module is used to acquire the pointer instrument image and perform preprocessing to obtain the pointer instrument data set;
[0034] The network model building module is used to improve the OCR segmentation network by adding a regional classification module and a global context vector enhancement module to obtain a hierarchical parallel network;
[0035] A model training module, used for inputting the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model;
[0036] An image segmentation module, used for inputting the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image;
[0037] A reading recognition module is used to perform reading recognition of the pointer scale based on the segmented image.
[0038] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps of the methods described in the above embodiments.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in each of the above embodiments are implemented.
[0040] The above-mentioned method for reading a pointer pressure gauge based on a hierarchical parallel network first obtains a pointer instrument image and performs preprocessing to obtain a pointer instrument data set; then, based on the OCR segmentation network, it is improved by adding a regional classification module and a global context vector enhancement module to obtain a hierarchical parallel network; then, the pointer instrument data set is input into the hierarchical parallel network for training to obtain a trained image deblurring model; then, the pointer pressure gauge image to be processed is input into the image deblurring model to obtain a segmented image; finally, the pointer scale reading is recognized based on the segmented image. In other words, a new cross-feature layer information fusion method is proposed to enhance the global context vector, and an overall semantic segmentation network structure based on OCRNet introducing a regional feature classification method and a global context vector enhancement strategy is given, wherein the regional feature classification method divides the target region features into a global context vector and a semantic category vector, and the global context vector enhancement strategy enriches the context expression ability of the global context vector, considers the context information of the spatial dimension and the channel dimension, improves the segmentation performance of the model, and improves the accuracy and stability of the pointer instrument panel reading based on deep learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 An application environment diagram of a pointer pressure gauge reading method based on a hierarchical parallel network in one embodiment;
[0042] Figure 2 A schematic diagram of a flow chart of a method for reading a pointer-type pressure gauge based on a hierarchical parallel network in one embodiment;
[0043] Figure 3 A schematic diagram of the structure of a hierarchical parallel network in one embodiment;
[0044] Figure 4 A schematic diagram of the structure of a backbone network in an embodiment;
[0045] Figure 5 is a schematic diagram of the structure of a region classification module in one embodiment;
[0046] Figure 6 is a schematic diagram of the structure of a global context vector enhancement module in one embodiment;
[0047] Figure 7 is a schematic diagram of a segmentation effect in one embodiment;
[0048] Figure 8 It is a structural block diagram of a pointer type pressure gauge reading device based on a hierarchical parallel network in one embodiment;
[0049] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The present application provides a method for reading a pointer pressure gauge based on a hierarchical parallel network, which can be applied to Figure 1 In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or it can be placed on the cloud or other network servers. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0052] In one embodiment, Figure 2 As shown in FIG. 1 , a pointer pressure gauge reading method based on a hierarchical parallel network is provided. The method is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0053] S201: Acquire a pointer instrument image and perform preprocessing to obtain a pointer instrument dataset.
[0054] In an embodiment of the present application, first, images of pointer instruments are acquired, and different pressure gauges are photographed when they are regularly pressurized and depressurized, and then framed and obtained. After cropping, it is ensured that the main part of the image is the pressure gauge, forming an initial data set of pointer instruments, a total of 8 types of pressure gauges, and then preprocessed to obtain a pointer instrument data set.
[0055] Specifically, in one embodiment of the present application, the preprocessing includes:
[0056] S301: marking the pointer, scale, and background in the pointer instrument image.
[0057] S303: Convert the format of the annotated pointer instrument image.
[0058] In one embodiment of the present application, the images in the initial data set are annotated by EasySeg software, with a total of three categories: pointer, scale, and background. Before it is officially put into the network for training, it needs to be converted into a format that meets the training requirements of the constructed network model. By parsing the json file to obtain the original image information, polygonal bounding box coordinate information, annotated target category and other information, an object detection label file with the same name as the json annotation file but of type txt is generated to obtain the pointer instrument data set.
[0059] S203: Based on the OCR segmentation network, improvements are made by adding a region classification module and a global context vector enhancement module to obtain a hierarchical parallel network.
[0060] Specifically, in one embodiment of the present application, the structure of the hierarchical parallel network includes:
[0061] S401: The backbone network performs semantic segmentation on the input image to obtain an initial category segmentation result and a feature map.
[0062] S403: Calculate the initial category segmentation result and the feature map using a matrix multiplication method to obtain a category region representation.
[0063] S405: Using a region classification module to classify the category region representation into a global context vector and a semantic category vector.
[0064] S407: Use a global context enhancement module to enhance the global context vector and merge it with the semantic category vector.
[0065] S409: Determine the object context feature representation based on the merged vector, and obtain an enhanced feature map after feature concatenation with the feature map, which is used to predict the pixel semantic category to obtain a fine category segmentation result.
[0066] In the embodiment of the present application, various parts of the original network are improved based on the OCR segmentation network, and a region classification module (Region Representation Classification, RPC) and a global context vector enhancement module (Global Class Enhancement, GCE) are added to obtain an improved network structure, that is, a hierarchical parallel network. Figure 3 As shown in the figure, it is a schematic diagram of the structure of the hierarchical parallel network. HRNet is used as the backbone network. The schematic diagram of the backbone network is shown in Figure 4As shown. Semantic segmentation is performed through the backbone network, and the context pixels are divided into a group of soft target areas. Each channel corresponds to a category segmentation result. The segmentation result is used as a coarse classification result to calculate the feature representation of the subsequent target area. After that, the coarse classification result is expanded into a two-dimensional vector, each row of which represents the probability that each pixel belongs to a certain type of object. At the same time, the feature map is expanded into two dimensions, and each column represents the feature of each pixel in a certain dimension. The category region representation is obtained by matrix multiplication. After that, the vector segmented from the soft target area is divided into a global context vector and a semantic category vector by using the regional classification module, and then the global context vector is enhanced by the global context vector enhancement module, and then the enhanced global context vector is merged with the original semantic category vector to replace the original vector, which is still the target region feature. After that, the relationship matrix between the pixel feature representation (feature map) output by the deepest layer of the network and the merged vector is calculated first, and then the object region features are weighted and summed according to the values of each pixel and object region feature representation in the relationship matrix to obtain the object context feature representation. Finally, the object context feature representation is concatenated with the feature representation of the deepest layer of the network input as the feature representation enhanced with the context information (enhanced feature map), and then the semantic category of each pixel is predicted based on the enhanced feature representation to achieve a more refined segmentation effect.
[0067] Specifically, in one embodiment of the present application, the area classification module includes:
[0068] S501: Convert the soft object region into a probability map.
[0069] S503: Perform coarse segmentation based on the probability map.
[0070] S505: Count the coarse segmentation results of the entire image to obtain a semantic category vector and a global context vector.
[0071] In one embodiment of the present application, the semantic segmentation task itself contains the idea of classification, and the category statistics of the soft object area predicted by the stage4 branch can be directly performed. The specific method is divided into three operations. First, the soft object area is converted into a probability map, and then a rough segmentation is performed based on the probability map to find the category of each pixel position in the image, and finally the category statistics of all pixels in the entire image are performed. Figure 5As shown in the figure, it is a schematic diagram of the structure of the regional classification module. The soft object region is taken as the output of the full convolutional network branch. The Softmax operation is performed along the channel dimension to obtain K probability maps. Then, the Argmax function is performed on these K probability maps to obtain the position index of the maximum value of the channel. These obtained position indexes are the predicted labels. After the label is visualized, the coarse segmentation image Mc is obtained. The coarse segmentation image Mc represents the predicted category of each pixel position. Mc is transformed into a one-dimensional label vector. The category of each position of this label vector is counted, and the repeated categories are removed. In this way, all the categories S predicted by the coarse segmentation of the input image are obtained. The regional features corresponding to these categories are called semantic category vectors fs, and the regional features corresponding to other categories are called global context vectors fg. These two types of vectors are still collectively called target region features.
[0072] In one embodiment of the present application, the global context vector enhancement module includes:
[0073] The global context vector is enhanced by using global average pooling and channel average pooling respectively.
[0074] In one embodiment of the present application, Figure 6 As shown in the figure, the global context vector enhancement module is designed with two branches, which process features with global average pooling and channel average pooling respectively. The former calculates the mean along the spatial dimension and directly outputs a C×1×1 context vector, which is responsible for capturing the global context in the spatial dimension; the latter calculates the mean along the channel dimension, first reduces the dimension to output a 1×H×W spatial attention map, then performs Softmax normalization along the spatial dimension, and then performs weighted summation with the features to generate a C×1×1 context vector, which is responsible for modeling the global dependency in the channel dimension. In order to fuse and enhance the global context vector (original global context vector) separated by the regional feature classification method, the C×1×1 vectors output by the global average pooling branch and the channel average pooling branch are upsampled into fa and fc, and finally the three fa, fc and fg are element-wise fused to output the enhanced global context vector.
[0075] S205: Inputting the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model.
[0076] In the embodiment of the present application, the pointer instrument data set is divided into a training set and a test set in a ratio of 8:2, and then the training set is input into a hierarchical parallel network for training. The experimental equipment in the training uses a single NVIDIA V10032G, and the deep learning framework is PyTorch. During the training process, the Adam optimizer is used for training, and the initial learning rate is set to 2×10-4, and then gradually reduced to 1×10-7 through the cosine annealing algorithm. The model training effect is tested with the test set, and finally a trained image deblurring model is obtained.
[0077] S207: Input the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image.
[0078] In the embodiment of the present application, the newly acquired pointer pressure gauge image to be processed is then input into the image deblurring model for segmentation to obtain a segmented image, that is, a segmentation mask of the pointer and scale in the input image, such as Figure 7 shown.
[0079] S209: Recognize the pointer scale reading based on the segmented image.
[0080] Finally, the image processing method is used to read and identify the pointers and scales obtained by segmentation.
[0081] Specifically, in one embodiment of the present application, the reading recognition of the pointer scale based on the segmented image includes:
[0082] S601: using an image erosion algorithm to erode the segmented image.
[0083] S603: Expand the annular dial in the segmented image into a rectangle, and perform binarization and noise reduction processing.
[0084] S605: Calculate the position of the pointer relative to each scale to obtain a reading result.
[0085] In one embodiment of the present application, the segmented image is firstly eroded by an image erosion algorithm to improve the separation between scales; secondly, the annular dial is expanded into a rectangle, specifically, the center position of the circle is determined as the geometric center point of the image, and the dial is expanded by polar coordinate conversion; the expanded rectangular image is binarized again and the two-dimensional image is converted into a one-dimensional array by image processing, that is, compressed into a linear format along the height direction; then mathematical operations are used to minimize the scale impact caused by incomplete segmentation or misidentification, including increasing and decreasing the pointer and adjusting the spacing according to the average value of the scale interval; finally, the reading is calculated by calculating the position of the pointer relative to each scale, and the specific calculation formula of the reading y is:
[0086]
[0087] Among them, m represents the number of scales to the left of the pointer, x is the position of the pointer, ml is one scale position to the left of the pointer, mr is one scale position to the right of the pointer, and v is the minimum scale value of the meter in the detected image.
[0088] In the above-mentioned method for reading a pointer pressure gauge based on a hierarchical parallel network, first, a pointer instrument image is obtained and preprocessed to obtain a pointer instrument data set; then, based on the OCR segmentation network, an improvement is made, and a regional classification module and a global context vector enhancement module are added to obtain a hierarchical parallel network; then, the pointer instrument data set is input into the hierarchical parallel network for training to obtain a trained image deblurring model; then, the pointer pressure gauge image to be processed is input into the image deblurring model to obtain a segmented image; finally, the pointer scale reading is recognized based on the segmented image. In other words, a new cross-feature layer information fusion method is proposed to enhance the global context vector, and an overall semantic segmentation network structure based on OCRNet introducing a regional feature classification method and a global context vector enhancement strategy is given, wherein the regional feature classification method divides the target region features into a global context vector and a semantic category vector, and the global context vector enhancement strategy enriches the context expression ability of the global context vector, considers the context information of the spatial dimension and the channel dimension, improves the segmentation performance of the model, and improves the accuracy and stability of the pointer instrument panel reading based on deep learning.
[0089] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0090] Based on the same inventive concept, the embodiment of the present application also provides a pointer pressure gauge reading device based on a hierarchical parallel network for implementing the above-mentioned pointer pressure gauge reading method based on a hierarchical parallel network. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more embodiments of a pointer pressure gauge reading device based on a hierarchical parallel network provided below can refer to the limitations of a pointer pressure gauge reading method based on a hierarchical parallel network above, and will not be repeated here.
[0091] In one embodiment, Figure 8 As shown, a pointer pressure gauge reading device 800 based on a hierarchical parallel network is provided, comprising: a data acquisition module 801, a network model building module 803, a model training module 805, an image segmentation module 807 and a reading recognition module 809, wherein:
[0092] The data acquisition module 801 is used to acquire the pointer instrument image and perform preprocessing to obtain the pointer instrument data set.
[0093] The network model building module 803 is used to improve the OCR segmentation network by adding a region classification module and a global context vector enhancement module to obtain a hierarchical parallel network.
[0094] The model training module 805 is used to input the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model.
[0095] The image segmentation module 807 is used to input the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image.
[0096] The reading recognition module 809 is used to recognize the reading of the pointer scale based on the segmented image.
[0097] In one embodiment of the present application, the data acquisition module is further used to:
[0098] Annotating the pointer, scale, and background in the pointer instrument image;
[0099] Convert the format of the annotated pointer instrument image.
[0100] In one embodiment of the present application, the structure of the hierarchical parallel network includes:
[0101] The backbone network performs semantic segmentation on the input image to obtain the initial category segmentation result and feature map;
[0102] The initial category segmentation result and the feature map are calculated by using a matrix multiplication method to obtain a category region representation;
[0103] A region classification module is used to classify the category region representation into a global context vector and a semantic category vector;
[0104] Using a global context enhancement module to enhance the global context vector and merge it with the semantic category vector;
[0105] The object context feature representation is determined based on the merged vector, and the enhanced feature map is obtained after feature concatenation with the feature map, which is used to predict the pixel semantic category to obtain a fine category segmentation result.
[0106] In one embodiment of the present application, the area classification module includes:
[0107] Convert soft object regions into probability maps;
[0108] Performing coarse segmentation based on the probability map;
[0109] The coarse segmentation results of the entire image are statistically analyzed to obtain the semantic category vector and the global context vector.
[0110] In one embodiment of the present application, the global context vector enhancement module includes:
[0111] The global context vector is enhanced by using global average pooling and channel average pooling respectively.
[0112] In one embodiment of the present application, the reading recognition module is further used for:
[0113] Using an image erosion algorithm to erode the segmented image;
[0114] Expand the annular dial in the segmented image into a rectangle, and perform binarization and noise reduction processing;
[0115] Calculate the position of the pointer relative to each scale to get the reading result.
[0116] Each module in the above-mentioned pointer pressure gauge reading device based on hierarchical parallel network can be fully or partially implemented by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module above.
[0117] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a pointer pressure gauge reading method based on a hierarchical parallel network is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0118] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0120] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0121] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0125] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A pointer pressure gauge reading method based on a hierarchical parallel network, characterized in that: The method comprises: Acquire the pointer instrument image and perform preprocessing to obtain the pointer instrument data set; Based on the OCR segmentation network, the regional classification module and the global context vector enhancement module are added to obtain a hierarchical parallel network. Inputting the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model; Inputting the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image; The pointer scale reading is recognized based on the segmented image.
2. A pointer pressure gauge reading method based on a hierarchical parallel network according to claim 1, characterized in that: The pre-processing comprises: Annotating the pointer, scale, and background in the pointer instrument image; Convert the format of the annotated pointer instrument image.
3. The method for reading a pointer pressure gauge based on a hierarchical parallel network according to claim 1, characterized in that: The structure of the hierarchical parallel network includes: The backbone network performs semantic segmentation on the input image to obtain the initial category segmentation result and feature map; The initial category segmentation result and the feature map are calculated by using a matrix multiplication method to obtain a category region representation; A region classification module is used to classify the category region representation into a global context vector and a semantic category vector; Using a global context enhancement module to enhance the global context vector and merge it with the semantic category vector; The object context feature representation is determined based on the merged vector, and the enhanced feature map is obtained after feature concatenation with the feature map, which is used to predict the pixel semantic category to obtain a fine category segmentation result.
4. The method for reading a pointer pressure gauge based on a hierarchical parallel network according to claim 1, characterized in that: The area classification module comprises: Convert soft object regions into probability maps; Performing coarse segmentation based on the probability map; The coarse segmentation results of the entire image are statistically analyzed to obtain the semantic category vector and the global context vector.
5. The method for reading a pointer pressure gauge based on a hierarchical parallel network according to claim 1, characterized in that: The global context vector enhancement module comprises: The global context vector is enhanced by using global average pooling and channel average pooling respectively.
6. The method for reading a pointer pressure gauge based on a hierarchical parallel network according to claim 1, characterized in that: The step of identifying the pointer scale reading based on the segmented image comprises: Using an image erosion algorithm to erode the segmented image; Expand the annular dial in the segmented image into a rectangle, and perform binarization and noise reduction processing; Calculate the position of the pointer relative to each scale to get the reading result.
7. A pointer pressure gauge reading device based on a hierarchical parallel network, characterized in that: The device comprises: The data acquisition module is used to acquire the pointer instrument image and perform preprocessing to obtain the pointer instrument data set; The network model building module is used to improve the OCR segmentation network by adding a regional classification module and a global context vector enhancement module to obtain a hierarchical parallel network; A model training module, used for inputting the pointer instrument data set into the hierarchical parallel network for training to obtain a trained image deblurring model; An image segmentation module, used for inputting the pointer pressure gauge image to be processed into the image deblurring model to obtain a segmented image; A reading recognition module is used to perform reading recognition of the pointer scale based on the segmented image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for realizing pointer type industrial instrument reading based on deep learning
CN118918303A