Pointer type instrument identification method and device based on improved UNet, and medium
By improving the abnormal reading of UNet network recognition pointer instruments, the problems of manpower dependence and lack of video analysis functions in the operation and maintenance of pump rooms in high-speed rail stations have been solved, and rapid identification and security improvement have been achieved.
Patent Information
- Application Number
- CN202411986007.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The water supply, drainage and operation and maintenance of pump rooms and related facilities in the high-speed rail station area relies on manpower and extensive management methods, resulting in the need to quickly carry out emergency repairs in the event of an emergency. The existing high-definition cameras cannot automatically analyze the key information in the video, and cannot timely identify abnormal readings of pointer instruments, which pose significant safety hazards.
Using the pointer instrument recognition method based on improved UNet, by building the dashboard dataset and training the improved UNet network, the dashboard recognition model is obtained, the key information in the video is recognized in real time, the instrument value is calculated, and abnormal readings of the pointer instrument are quickly discovered.
It realizes timely identification of key information in the video, and quickly discovers abnormal readings of pointer instruments, reducing safety hazards and improving operation and maintenance efficiency and safety.
Smart Images

Figure CN119904871A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit safety technology, and more specifically, to a pointer instrument recognition method, device and medium based on improved UNet. Background Art
[0002] The pump house and other related facilities in the high-speed railway station area provide multiple services for the line, station and production units, such as flood control, waterlogging prevention and drainage, fire water, and daily production and living water. These services have a direct impact on line safety, driving safety and the quality of passenger service at the station, so the responsibility is very heavy.
[0003] At present, the operation and maintenance of water supply and drainage of high-speed railways mainly rely on manpower, and the management method is relatively extensive. A large amount of human resources are used for manual duty, regular maintenance and line inspection of pump rooms. In the event of an emergency, emergency repairs must be carried out quickly, which requires each station to be equipped with on-duty personnel to monitor the operation of the equipment, resulting in a huge workload for maintenance services. Although the existing pump rooms are equipped with high-definition cameras to monitor the operating environment, the massive real-time monitoring videos provided by these cameras lack automatic analysis functions, and cannot promptly identify key information in the video, nor can they quickly detect abnormal readings of pointer instruments, thus posing significant safety hazards. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a pointer instrument recognition method, device and medium based on improved UNet, so as to quickly and accurately identify key information in the video and improve safety.
[0005] In a first aspect, the present invention provides a pointer instrument recognition method based on an improved UNet, the method comprising:
[0006] Construct a dashboard dataset, and use the dashboard dataset to train and improve the UNet network to obtain a dashboard recognition model;
[0007] A real-time instrument panel image is acquired, and the real-time instrument panel image is input into the instrument panel recognition model to calculate the instrument value.
[0008] Furthermore, the improved UNet network includes a decoding layer and an encoding layer, and the encoding layer includes 12 structural layers connected in sequence, wherein:
[0009] The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32;
[0010] The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32;
[0011] The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels;
[0012] The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels;
[0013] The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128;
[0014] The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128;
[0015] The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256;
[0016] The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256;
[0017] The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512;
[0018] The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512;
[0019] The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024;
[0020] The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024;
[0021] The results of the 4th, 6th, 8th, 10th, and 12th layers are the input to the decoding layer of the UNet network.
[0022] Furthermore, the dashboard dataset is used to train an improved UNet network to obtain a dashboard recognition model, including:
[0023] A grayscale mask image is used as a dashboard data set; wherein the value at the large scale in the grayscale mask image is 1, the value at the pointer is 2, and the rest are 0;
[0024] The dashboard data set is imported into the improved UNet network, and the adaptive momentum stochastic optimization method is used for training to obtain the dashboard recognition model.
[0025] Further, obtaining a real-time instrument panel image, inputting the real-time instrument panel image into the instrument panel recognition model, and calculating the instrument value, including:
[0026] Using a real-time dashboard image as an original image, setting a region of interest, and cropping the original image to obtain a rectangular target image; inputting the rectangular target image into the dashboard recognition model to obtain a rectangular mask image M;
[0027] The rectangular mask image M is expanded with the center point (c, c) to obtain a feature map T with a width of w and a height of c respectively. The pixel values of the feature map T satisfy T(i, j) = M(m, n); where i and j are pixel coordinate indices satisfying
[0028]
[0029] Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin;
[0030] Determine the instrument scale index k q , q=1,2θ…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k 0 =(k -1 +k -2 ) / 2;
[0031] According to k r <k 0 <k r+1 Determine the index r where k r is the rth instrument scale index, k r+1 It is the index of the r+1th instrument scale; according to the preset range and index r, the current instrument value is calculated.
[0032] Furthermore, according to the preset range and index r, the current instrument value is calculated by the following formula:
[0033]
[0034] Where d is the instrument value and W is the preset range.
[0035] In a second aspect, the present invention provides a pointer instrument recognition device based on an improved UNet, the device comprising:
[0036] A model training module is configured to construct a dashboard data set, and use the dashboard data set to train and improve the UNet network to obtain a dashboard recognition model;
[0037] The instrument recognition module is configured to obtain a real-time instrument panel image, input the real-time instrument panel image into the instrument panel recognition model, and calculate the instrument value.
[0038] Furthermore, the improved UNet network includes a decoding layer and an encoding layer, and the encoding layer includes 12 structural layers connected in sequence, wherein:
[0039] The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32;
[0040] The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32;
[0041] The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels;
[0042] The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels;
[0043] The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128;
[0044] The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128;
[0045] The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256;
[0046] The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256;
[0047] The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512;
[0048] The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512;
[0049] The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024;
[0050] The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024;
[0051] The results of the 4th, 6th, 8th, 10th, and 12th layers are the input to the decoding layer of the UNet network.
[0052] Furthermore, the instrument identification module is further configured to:
[0053] Using a real-time dashboard image as an original image, setting a region of interest, and cropping the original image to obtain a rectangular target image; inputting the rectangular target image into the dashboard recognition model to obtain a rectangular mask image M;
[0054] The rectangular mask image M is expanded with the center point (c, c) to obtain a feature map T with a width of w and a height of c respectively. The pixel values of the feature map T satisfy T(i, j) = M(m, n); where i and j are pixel coordinate indices satisfying
[0055]
[0056] Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin;
[0057] Determine the instrument scale index k q , q=1,2θ…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k 0 =(k -1 +k -2 ) / 2;
[0058] According to k r <k 0 <k r+1 Determine the index r where k r is the rth instrument scale index, k r+1 It is the index of the r+1th instrument scale; according to the preset range and index r, the current instrument value is calculated.
[0059] Furthermore, the instrument identification module is further configured to calculate the current instrument value according to the preset range and index r by the following formula:
[0060]
[0061] Where d is the instrument value and W is the preset range.
[0062] In a third aspect, the present invention provides a readable storage medium, wherein the readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method as described above.
[0063] The present invention has at least the following beneficial effects:
[0064] The present invention uses historical data sets to train the improved UNet network to obtain a dashboard recognition model. Based on the dashboard recognition model, key information in the video can be identified in a timely manner, so as to quickly discover abnormal readings of pointer instruments, thereby eliminating safety hazards as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 The figure shows an overall flow chart of a pointer instrument recognition method based on improved UNet according to an embodiment of the present invention.
[0066] Figure 2 A prediction flow chart of a pointer instrument recognition method based on improved UNet according to an embodiment of the present invention is shown.
[0067] Figure 3 A structural diagram of a pointer instrument recognition device based on improved UNet according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0068] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and specific embodiments, but are not intended to limit the present invention. For the various steps described herein, if there is no necessity for a causal relationship between each other, the order in which they are described as examples herein should not be regarded as a limitation, and those skilled in the art should know that they can be adjusted in order, as long as the logic between them is not destroyed, resulting in the inability to implement the entire process.
[0069] The embodiment of the present invention provides a pointer instrument recognition method based on improved UNet, such as Figure 1 , which is a flow chart of a pointer instrument recognition method based on improved UNet. The pointer instrument recognition method based on improved UNet includes steps S10 to S20, which are described in detail as follows.
[0070] S10: Construct a dashboard dataset, and use the dashboard dataset to train an improved UNet network to obtain a dashboard recognition model.
[0071] In some embodiments, step S10 is implemented by the following steps S11 to S12.
[0072] Step S11: Improve the UNet network to obtain an improved UNet network, whose encoding layer structure is:
[0073] The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32;
[0074] The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32;
[0075] The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels;
[0076] The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels;
[0077] The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128;
[0078] The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128;
[0079] The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256;
[0080] The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256;
[0081] The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512;
[0082] The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512;
[0083] The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024;
[0084] The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024;
[0085] The results of the 4th, 6th, 8th, 10th, and 12th layers are the inputs of the original decoding layer of the UNet network.
[0086] Step S12: Using the grayscale mask image as the instrument panel data set, the value at the large scale of the grayscale mask image is 1, the value at the pointer is 2, and the rest are 0; importing the instrument panel data set into the improved UNet network for training to obtain the instrument panel recognition model; wherein the training uses the random optimization method of adaptive momentum.
[0087] S20: Acquire a real-time instrument panel image, input the real-time instrument panel image into the instrument panel recognition model, and calculate instrument values.
[0088] In some embodiments, step S20 is implemented by the following steps S21 to S24.
[0089] S21: setting a region of interest, cropping the original image, and obtaining a rectangular target image; inputting the target image into the trained network to obtain a rectangular mask image M.
[0090] S22: Expand the rectangular mask image M with the center point (c, c) to obtain a feature image T with a width of w and a height of c respectively, where the pixel values satisfy T(i, j) = M(m, n), and the pixel coordinate indexes i and j satisfy:
[0091]
[0092] Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin.
[0093] S23: Determine the instrument scale index k q , q=1,2,…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k 0 =(k -1 +k -2 ) / 2.
[0094] S24: Predict the range to be W; determine the index r, satisfying k r <k 0 <k r+1 ; Calculate the current instrument value
[0095] To facilitate the understanding of those skilled in the art, a pointer instrument recognition method based on improved UNet is now described with a specific embodiment, which includes the following steps: Step 1, constructing a dashboard data set, training the improved UNet network to obtain a dashboard recognition model; Step 2, inputting the real-time dashboard image into the dashboard recognition model to calculate the instrument value.
[0096] Specifically, the training of the improved UNet network in step 1 includes: in step 12, the dashboard data set format is the original image and its grayscale label image of the same size, and the training data set uses a total of 7294 images; the training uses the adaptive momentum method, and its hyperparameters are the learning rate of 0.005, the first-order moment decay rate of 0.85, the second-order moment decay rate of 0.95, and the small constant of 10 -7 .
[0097] Specifically, Figure 2 As shown, the calculation of the instrument value in step 2 includes:
[0098] Step 22, expand the graph M with the center point (224, 224) to obtain a feature graph T with a width and height of 512 and 224 respectively;
[0099] Step 23, the scale height threshold is 20, the pointer height threshold is 100; the 9 instrument scale indexes are 52, 97, 142, 187, 227, 268, 310, 352, 398; the pointer left edge index is 68, the pointer left edge index is 77; the pointer index is 72;
[0100] Step 24, predict the range to be 1.6; index r to be 1; calculate the current instrument value
[0101] The embodiment of the present invention also provides a pointer instrument recognition device based on improved UNet, such as Figure 3 As shown, the device comprises:
[0102] The model training module 301 is configured to construct a dashboard data set, and use the dashboard data set to train and improve the UNet network to obtain a dashboard recognition model;
[0103] The instrument recognition module 302 is configured to obtain a real-time instrument panel image, input the real-time instrument panel image into the instrument panel recognition model, and calculate instrument values.
[0104] In some embodiments, the improved UNet network includes a decoding layer and an encoding layer, and the encoding layer includes 12 structural layers connected in sequence, wherein:
[0105] The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32;
[0106] The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32;
[0107] The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels;
[0108] The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels;
[0109] The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128;
[0110] The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128;
[0111] The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256;
[0112] The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256;
[0113] The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512;
[0114] The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512;
[0115] The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024;
[0116] The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024;
[0117] The results of the 4th, 6th, 8th, 10th, and 12th layers are the input to the decoding layer of the UNet network.
[0118] In some embodiments, the meter identification module is further configured to:
[0119] Using a real-time dashboard image as an original image, setting a region of interest, and cropping the original image to obtain a rectangular target image; inputting the rectangular target image into the dashboard recognition model to obtain a rectangular mask image M;
[0120] The rectangular mask image M is expanded with the center point (c, c) to obtain a feature map T with a width of w and a height of c respectively. The pixel values of the feature map T satisfy T(i, j) = M(m, n); where i and j are pixel coordinate indices satisfying
[0121]
[0122] Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin;
[0123] Determine the instrument scale index k q , q=1,2θ…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k0 =(k -1 +k -2 ) / 2;
[0124] According to k r <k 0 <k r+1 Determine the index r where k r is the rth instrument scale index, k r+1 It is the index of the r+1th instrument scale; according to the preset range and index r, the current instrument value is calculated.
[0125] In some embodiments, the meter identification module is further configured to calculate the current meter value according to the preset range and index r by the following formula:
[0126]
[0127] Where d is the instrument value and W is the preset range.
[0128] It should be noted that the structures of the various pointer instrument identification devices based on improved UNet described in this embodiment belong to the same technical concept as the pointer instrument identification method based on improved UNet described previously, and achieve the same beneficial effects through the same principles, which will not be repeated here.
[0129] An embodiment of the present invention further provides a readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method described in any of the above embodiments.
[0130] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present invention with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of this application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0131] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as a feature of an invention that is not claimed for protection being necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of the embodiments of a specific invention. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the full scope of the equivalent forms of the attached claims and these claims.
Claims
1. A pointer instrument recognition method based on improved UNet, characterized in that: The method comprises: Construct a dashboard dataset, and use the dashboard dataset to train and improve the UNet network to obtain a dashboard recognition model; A real-time instrument panel image is acquired, and the real-time instrument panel image is input into the instrument panel recognition model to calculate the instrument value.
2. According to the improved UNet-based pointer instrument recognition method of claim 1, it is characterized in that: The improved UNet network includes a decoding layer and an encoding layer, and the encoding layer includes 12 structural layers connected in sequence, wherein: The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32; The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32; The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels; The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels; The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128; The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128; The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256; The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256; The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512; The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512; The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024; The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024; The results of the 4th, 6th, 8th, 10th, and 12th layers are the input to the decoding layer of the UNet network.
3. The pointer instrument recognition method based on improved UNet according to claim 2 is characterized in that: The dashboard dataset is used to train and improve the UNet network to obtain a dashboard recognition model, including: A grayscale mask image is used as a dashboard data set; wherein the value at the large scale in the grayscale mask image is 1, the value at the pointer is 2, and the rest are 0; The dashboard data set is imported into the improved UNet network, and the adaptive momentum stochastic optimization method is used for training to obtain the dashboard recognition model.
4. The pointer instrument recognition method based on improved UNet according to claim 1 is characterized in that: Acquiring a real-time instrument panel image, inputting the real-time instrument panel image into the instrument panel recognition model, and calculating instrument values, including: Using a real-time dashboard image as an original image, setting a region of interest, and cropping the original image to obtain a rectangular target image; inputting the rectangular target image into the dashboard recognition model to obtain a rectangular mask image M; The rectangular mask image M is expanded with the center point (c, c) to obtain a feature map T with a width of w and a height of c respectively. The pixel values of the feature map T satisfy T(i, j) = M(m, n); where i and j are pixel coordinate indices satisfying Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin; Determine the instrument scale index k q , q=1,2θ…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k0=(k -1 +k -2 ) / 2; According to k r <k0<k r+1 Determine the index r where k r is the rth instrument scale index, k r+1 It is the index of the r+1th instrument scale; according to the preset range and index r, the current instrument value is calculated.
5. The pointer instrument recognition method based on improved UNet according to claim 4 is characterized in that: According to the preset range and index r, the current instrument value is calculated by the following formula: Where d is the instrument value and W is the preset range.
6. A pointer instrument recognition device based on improved UNet, characterized in that: The device comprises: A model training module is configured to construct a dashboard data set, and use the dashboard data set to train and improve the UNet network to obtain a dashboard recognition model; The instrument recognition module is configured to obtain a real-time instrument panel image, input the real-time instrument panel image into the instrument panel recognition model, and calculate the instrument value.
7. The pointer meter recognition device based on improved UNet according to claim 6 is characterized in that: The improved UNet network includes a decoding layer and an encoding layer, and the encoding layer includes 12 structural layers connected in sequence, wherein: The first layer is a convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 32; The second layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 32; The third layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and 64 output channels; The fourth layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels; The fifth layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 128; The sixth layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and an output channel of 128; The 7th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 256; The 8th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 256; The 9th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 512; The 10th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 512; The 11th layer is a point-by-point convolution layer with a kernel of 1×1, a stride of 1, and an output channel of 1024; The 12th layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and an output channel of 1024; The results of the 4th, 6th, 8th, 10th, and 12th layers are the input to the decoding layer of the UNet network.
8. The pointer meter recognition device based on improved UNet according to claim 6 is characterized in that: The instrument identification module is further configured to: Using a real-time dashboard image as an original image, setting a region of interest, and cropping the original image to obtain a rectangular target image; inputting the rectangular target image into the dashboard recognition model to obtain a rectangular mask image M; The rectangular mask image M is expanded with the center point (c, c) to obtain a feature map T with a width of w and a height of c respectively. The pixel values of the feature map T satisfy T(i, j) = M(m, n); where i and j are pixel coordinate indices satisfying Where m is the horizontal coordinate of the image after expansion, n is the vertical coordinate of the image after expansion, c is the horizontal coordinate of the center point of the mask image, ρ is the polar diameter of the polar coordinate system with the center point as the origin, and θ is the polar angle of the polar coordinate system with the center point as the origin; Determine the instrument scale index k q , q=1,2θ…n, n represents the number of large scales, satisfying and a is the scale height threshold; determine the pointer left edge index k -1 ,satisfy and b is the pointer height threshold; determine the pointer right edge index k -2 ,satisfy and The pointer index is k0=(k -1 +k -2 ) / 2; According to k r <k0<k r+1 Determine the index r where k r is the rth instrument scale index, k r+1 is the r+1th instrument scale index; Calculate the current instrument value based on the preset range and index r.
9. The pointer meter recognition device based on improved UNet according to claim 8 is characterized in that: The instrument identification module is further configured to calculate the current instrument value according to the preset range and index r by the following formula: Where d is the instrument value and W is the preset range. 10 . A non-transitory computer-readable storage medium storing instructions, which, when executed by a processor, executes the method according to claim 1 .
Citation Information
Patent Citations
Method and system for extracting characters and identifying contents of pictures
CN110020615A
Pointer type instrument automatic reading method based on radial gray scale
CN111950559A
Farmland boundary identification method and system
CN113221740A
Pointer instrument automatic reading method based on deep learning
CN113837166A
Intelligent identification method for arc-shaped display instrument of main control room of nuclear power plant
CN117392651A