Digital recognition methods, devices, and media based on lightweight networks
By constructing a lightweight network and training a digit recognition model, the efficiency and accuracy issues of digital tube digit recognition in images were solved, and fast and accurate data acquisition was achieved.
Patent Information
- Application Number
- CN202510009716.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-01-03
AI Technical Summary
Existing technologies lack a solution for quickly and accurately identifying the digits in digital tubes in images, resulting in low efficiency in pump room monitoring and inaccurate data acquisition.
A lightweight network is constructed, and a digit recognition model is trained using an adaptive momentum stochastic optimization method. The digital tube digits are extracted from real-time images using regions of interest, and a 14-layer convolutional and fully connected layer structure is used for recognition.
It improves the accuracy and efficiency of data reading, and enables rapid and accurate recognition of digital tube numbers.
Smart Images

Figure CN119942552B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent operation and maintenance technology for rail transit, and more specifically, to a digital identification method, device, and medium based on lightweight networks. Background Technology
[0002] In modern railway systems, pump houses, as crucial infrastructure, are responsible for maintaining a stable supply of water and liquids to ensure the normal operation and safety of trains. However, traditional pump house monitoring methods often rely on manual inspections and recording, which is not only inefficient but also prone to human error, affecting the system's reliability and safety. With the development of digital technology, automated monitoring systems have gradually become an important means of improving pump house management efficiency. By using cameras to capture real-time images of the digital displays within the pump house, automatic monitoring and recording of equipment status can be achieved. The application of this technology not only improves the accuracy and real-time nature of data acquisition but also reduces manual intervention and lowers management costs.
[0003] However, based on the real-time image data captured by cameras, there is currently a lack of a solution for quickly identifying the digits on the digital tube displays within the image data. Therefore, how to quickly and accurately identify the digits on the digital tube displays in an image is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a digital recognition method, apparatus, and medium based on lightweight networks, which can quickly and accurately identify digital tube digits in images, thereby improving the accuracy and efficiency of data reading.
[0005] In a first aspect, the present invention provides a digital recognition method based on lightweight networks, the method comprising:
[0006] A lightweight network is constructed and trained on a digital tube digit dataset to obtain a digit recognition model.
[0007] A real-time image is acquired, and based on a preset region of interest for digital recognition, the images of each region of interest in the real-time image are input into the digital recognition model to obtain digital numerical results.
[0008] Furthermore, the lightweight network includes 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer.
[0009] Furthermore, the first module layer is a convolutional layer with a kernel of 3×3, a stride of 2, and 32 output channels;
[0010] The second module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 32 output channels;
[0011] The third module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 64 output channels.
[0012] The fourth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels.
[0013] The fifth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 128 output channels;
[0014] The sixth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and 128 output channels;
[0015] The seventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 256 output channels.
[0016] The eighth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels;
[0017] The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels.
[0018] The tenth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels;
[0019] The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels;
[0020] The twelfth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels;
[0021] The thirteenth module layer is an average pooling layer with a 1×1 kernel;
[0022] The fourteenth module layer is a fully connected layer. After activation, it outputs the probability of each predicted label with a length of 11.
[0023] Furthermore, a digit recognition model is obtained by training based on the digital tube digit dataset, including:
[0024] The network parameters are continuously updated and the loss function value is recalculated using an adaptive momentum stochastic optimization method until the loss function value converges or reaches a predetermined number of iterations, resulting in a trained lightweight network. This trained lightweight network is then used as the digit recognition model.
[0025] Further, real-time images are acquired, and based on preset regions of interest for digital recognition, the images of each region of interest in the real-time images are input into the digital recognition model to obtain digital numerical results, including:
[0026] Using the location of each symbol in the numbers as the region of interest, the region of interest image is extracted from the real-time image;
[0027] The region of interest is input into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest;
[0028] The individual digit detection results of each region of interest image are concatenated sequentially to obtain a string of digit detection results as the digit numerical result.
[0029] Secondly, the present invention provides a digital identification device based on a lightweight network, the device comprising:
[0030] The model building module is configured to build a lightweight network, train it based on the digital tube dataset, and obtain a digit recognition model.
[0031] The image recognition module is configured to acquire real-time images, and based on preset regions of interest for digital recognition, input the images of each region of interest in the real-time image into the digital recognition model to obtain digital numerical results.
[0032] Furthermore, the lightweight network includes 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer.
[0033] Furthermore, the first module layer is a convolutional layer with a kernel of 3×3, a stride of 2, and 32 output channels;
[0034] The second module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 32 output channels;
[0035] The third module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 64 output channels.
[0036] The fourth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels.
[0037] The fifth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 128 output channels;
[0038] The sixth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and 128 output channels;
[0039] The seventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 256 output channels.
[0040] The eighth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels;
[0041] The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels.
[0042] The tenth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels;
[0043] The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels;
[0044] The twelfth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels;
[0045] The thirteenth module layer is an average pooling layer with a 1×1 kernel;
[0046] The fourteenth module layer is a fully connected layer. After activation, it outputs the probability of each predicted label with a length of 11.
[0047] Furthermore, the image recognition module is further configured as follows:
[0048] Using the location of each symbol in the numbers as the region of interest, the region of interest image is extracted from the real-time image;
[0049] The region of interest is input into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest;
[0050] The individual digit detection results of each region of interest image are concatenated sequentially to obtain a string of digit detection results as the digit numerical result.
[0051] Thirdly, the present invention provides a readable storage medium storing one or more programs that can be executed by one or more processors to implement the method described above.
[0052] The present invention has at least the following beneficial effects:
[0053] This invention trains a lightweight network using historical datasets to obtain a digit recognition model. Based on this model, the display data of the digital tube in a real-time image captured by a camera can be quickly identified through a preset region of interest. Compared with the traditional manual reading method, this can effectively improve the accuracy and efficiency of data reading. Attached Figure Description
[0054] Figure 1 A flowchart of a digital recognition method based on a lightweight network according to an embodiment of the present invention is shown.
[0055] Figure 2 A flowchart of digital value recognition according to an embodiment of the present invention is shown.
[0056] Figure 3 The output of a digital recognition model according to an embodiment of the present invention is shown.
[0057] Figure 4 A structural diagram of a digital identification device based on a lightweight network according to an embodiment of the present invention is shown. Detailed Implementation
[0058] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific examples, but this is not intended to limit the present invention. If there is no necessary sequential relationship between the various steps described herein, the order in which they are described as examples should not be considered a limitation. Those skilled in the art should understand that the order can be adjusted, as long as it does not disrupt the logical consistency between them and render the entire process impossible.
[0059] This invention provides a digital recognition method based on lightweight networks, such as... Figure 1 The diagram shows a flowchart of a digit recognition method based on lightweight networks. This digit recognition method based on lightweight networks includes steps S10 to S20, which are described in detail below.
[0060] S10: Construct a lightweight network, train it based on the digital tube dataset, and obtain a digit recognition model.
[0061] In this embodiment, the lightweight network includes 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer.
[0062] Specifically, the first module layer is a convolutional layer with a 3×3 kernel, a stride of 2, and 32 output channels; the second module layer is a depthwise convolutional layer with a 3×3 kernel, a stride of 1, and 32 output channels; the third module layer is a pointwise convolutional layer with a 1×1 kernel, a stride of 1, and 64 output channels; the fourth module layer is a depthwise convolutional layer with a 3×3 kernel, a stride of 1, and 64 output channels; the fifth module layer is a pointwise convolutional layer with a 1×1 kernel, a stride of 1, and 128 output channels; the sixth module layer is a depthwise convolutional layer with a 3×3 kernel, a stride of 2, and 128 output channels; and the seventh module layer is a pointwise convolutional layer with a 1×1 kernel, a stride of 1, and 2 output channels. 56; The eighth module layer is a depthwise convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels; The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels; The tenth module layer is a depthwise convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels; The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels; The twelfth module layer is a depthwise convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels; The thirteenth module layer is an average pooling layer with a kernel of 1×1; The fourteenth module layer is a fully connected layer, which, after activation, represents the probability of each predicted label, with an output length of 11.
[0063] In some embodiments, training a digital recognition model based on a digital tube dataset includes: continuously updating network parameters and recalculating the loss function value using an adaptive momentum stochastic optimization method until the loss function value converges or reaches a predetermined number of iterations, thereby obtaining a trained lightweight network, and using the trained lightweight network as the digital recognition model.
[0064] For example, a track dataset is selected as the digital tube dataset, which consists of images and labels. Each image contains only a single digit or a decimal point. In this embodiment, there are 12,000 images and 12,000 labels. The training set accounts for 80% of the dataset, and the test set accounts for 20%. During training, the Adam optimizer is used to train the network, with a predetermined number of iterations of 800 steps and a learning rate of 0.0002.
[0065] S20: Acquire a real-time image, and based on the preset regions of interest for digital recognition, input the images of each region of interest in the real-time image into the digital recognition model to obtain digital numerical results.
[0066] In some embodiments, as Figure 2 The diagram shows the flowchart for digit recognition. Step S20 is implemented through the following steps:
[0067] S21: Using the position of each symbol in the number as the region of interest, extract the region of interest image from the real-time image;
[0068] S22: Input the region of interest into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest;
[0069] S23: Sequentially concatenate the individual digit detection results of each region of interest image to obtain a string of digit detection results as the digit numerical result.
[0070] For example, one embodiment yields the following results: Figure 3 As shown, the image size is 300*500, and four regions of interest are set, such as... Figure 3 As shown in the box; the model output has 5 labels, which are “0”, “.”, “3”, “4”, and “8” in that order; after concatenation, the detection result is 0.348.
[0071] This invention also provides a digital recognition device based on a lightweight network, such as... Figure 4 As shown, the device includes:
[0072] The model building module 401 is configured to build a lightweight network, train it based on the digital tube digit dataset, and obtain a digit recognition model.
[0073] The image recognition module 402 is configured to acquire real-time images, and based on preset regions of interest for digital recognition, input the images of each region of interest in the real-time image into the digital recognition model to obtain digital numerical results.
[0074] In some embodiments, the lightweight network includes 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer.
[0075] In some embodiments, the first module layer is a convolutional layer with a kernel of 3×3, a stride of 2, and 32 output channels;
[0076] The second module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 32 output channels;
[0077] The third module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 64 output channels.
[0078] The fourth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels.
[0079] The fifth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 128 output channels;
[0080] The sixth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and 128 output channels;
[0081] The seventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 256 output channels.
[0082] The eighth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels;
[0083] The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels.
[0084] The tenth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels;
[0085] The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels;
[0086] The twelfth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels;
[0087] The thirteenth module layer is an average pooling layer with a 1×1 kernel;
[0088] The fourteenth module layer is a fully connected layer. After activation, it outputs the probability of each predicted label with a length of 11.
[0089] In some embodiments, the image recognition module is further configured to:
[0090] Using the location of each symbol in the numbers as the region of interest, the region of interest image is extracted from the real-time image;
[0091] The region of interest is input into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest;
[0092] The individual digit detection results of each region of interest image are concatenated sequentially to obtain a string of digit detection results as the digit numerical result.
[0093] It should be noted that the structures of the various lightweight network-based digital identification devices described in this embodiment belong to the same technical concept as the previously described lightweight network-based digital identification methods, achieving the same beneficial effects through the same principles, and will not be elaborated here.
[0094] This invention also provides a readable storage medium storing one or more programs that can be executed by one or more processors to implement the methods described in any of the above embodiments.
[0095] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on the invention that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, and such examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0096] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments can be used by those skilled in the art when reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the invention. This should not be construed as an intention that a feature of an unclaimed invention is necessary for any claim. Rather, the subject matter of the invention may be less than all the features of a particular embodiment of the invention. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated to be combined with each other in various combinations or arrangements. The scope of the invention should be determined by reference to the appended claims and the full scope of their equivalents.
Claims
1. A digital recognition method based on lightweight networks, characterized in that, The method includes: A lightweight network is constructed and trained on a digital tube digit dataset to obtain a digit recognition model. A real-time image is acquired, and based on a preset region of interest for digital recognition, the images of each region of interest in the real-time image are input into the digital recognition model to obtain digital numerical results. The lightweight network comprises 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer; The first module layer is a convolutional layer with a kernel size of 3×3, a stride of 2, and 32 output channels; The second module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 32 output channels; The third module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 64 output channels. The fourth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels. The fifth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 128 output channels; The sixth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and 128 output channels; The seventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 256 output channels. The eighth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels; The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels. The tenth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels; The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels; The twelfth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels; The thirteenth module layer is an average pooling layer with a 1×1 kernel; The fourteenth module layer is a fully connected layer. After activation, it outputs the probability of each predicted label, with an output length of 11. Acquire real-time images, and based on preset regions of interest for digital recognition, input each region of interest image from the real-time image into the digital recognition model to obtain digital numerical results, including: Using the location of each symbol in the numbers as the region of interest, the region of interest image is extracted from the real-time image; The region of interest is input into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest; The individual digit detection results of each region of interest image are concatenated sequentially to obtain a string of digit detection results as the digit numerical result.
2. The digital recognition method based on lightweight networks according to claim 1, characterized in that, A digit recognition model is obtained by training on a digital tube digit dataset, including: The network parameters are continuously updated and the loss function value is recalculated using an adaptive momentum stochastic optimization method until the loss function value converges or reaches a predetermined number of iterations, resulting in a trained lightweight network. This trained lightweight network is then used as the digit recognition model.
3. A digital identification device based on a lightweight network, characterized in that, The device includes: The model building module is configured to build a lightweight network, train it based on the digital tube dataset, and obtain a digit recognition model. The image recognition module is configured to acquire real-time images, and based on preset regions of interest for digital recognition, input the images of each region of interest in the real-time image into the digital recognition model to obtain digital numerical results; The lightweight network comprises 14 sequentially connected module layers, namely the first module layer, the second module layer, the third module layer, the fourth module layer, the fifth module layer, the sixth module layer, the seventh module layer, the eighth module layer, the ninth module layer, the tenth module layer, the eleventh module layer, the twelfth module layer, the thirteenth module layer, and the fourteenth module layer; The first module layer is a convolutional layer with a kernel size of 3×3, a stride of 2, and 32 output channels; The second module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 32 output channels; The third module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 64 output channels. The fourth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 64 output channels. The fifth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 128 output channels; The sixth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 2, and 128 output channels; The seventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 256 output channels. The eighth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 256 output channels; The ninth module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 512 output channels. The tenth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 512 output channels; The eleventh module layer is a pointwise convolutional layer with a kernel of 1×1, a stride of 1, and 1024 output channels; The twelfth module layer is a deep convolutional layer with a kernel of 3×3, a stride of 1, and 1024 output channels; The thirteenth module layer is an average pooling layer with a 1×1 kernel; The fourteenth module layer is a fully connected layer. After activation, it outputs the probability of each predicted label, with an output length of 11. The image recognition module is further configured as follows: Using the location of each symbol in the numbers as the region of interest, the region of interest image is extracted from the real-time image; The region of interest is input into the digit recognition model to obtain a vector of length 11; the first to tenth bits of the vector represent the probability of the digits 0 to 9, and the eleventh bit represents the probability of the decimal point; the label corresponding to the highest probability is the string of a single digit in the current region of interest; The individual digit detection results of each region of interest image are concatenated sequentially to obtain a string of digit detection results as the digit numerical result.
4. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, perform the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Embedded instrument code disc character automatic identification system and method
CN113936280A