Water gauge scale intelligent reading method based on target detection and semantic segmentation
The integration of target detection and semantic segmentation networks enhances water gauge scale reading accuracy by segmenting and classifying water gauge components, addressing incomplete letter E detection and reflection interference.
Patent Information
- Application Number
- CN202411042767.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-10
AI Technical Summary
Existing water gauge scale reading technologies face challenges in accurately identifying water level information due to incomplete letter E detection and interference from water reflections, especially in complex video surveillance scenes.
A method combining target detection and semantic segmentation, utilizing a water gauge scale intelligent reading system that includes a character target detection network, semantic segmentation network, and letter E classification network, to accurately identify and segment water gauge components and calculate the scale.
The method achieves higher accuracy and reliability in water gauge scale reading by effectively segmenting the water gauge from background reflections and classifying different forms of the letter E, resulting in precise water level measurements.
Smart Images

Figure CN119107635A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of water gauge scale reading, and specifically is a water gauge scale intelligent reading method based on target detection and semantic segmentation. Background Art
[0002] Water level indicators intuitively show the changes in water conditions in water areas, which are usually closely related to the increase or decrease in water volume. Stable and accurate water level tracking plays an irreplaceable role in water resource management and disaster prevention, and it also reflects the country's strength in water resource monitoring. With the continuous increase in water level monitoring points, real-time monitoring has become easier, and water gauges, as the most basic water level measurement tool, have become common equipment in hydrological observation. In recent years, many key water level monitoring points in China have been equipped with video monitoring and water gauges, which provide a basis for video image analysis. Using these monitoring systems, water gauges can be remotely monitored through image capture technology, and image analysis technology can be used to automatically read water level information.
[0003] At present, there are two main applications of image processing technology in water level recognition: one is traditional image processing, which involves image binarization and morphological operations. However, these traditional technologies may generate more noise in complex environments or low light conditions. The other is to use deep learning technology, especially target detection, to identify the water level scale. This method may be limited because the letter E at the bottom of the water level is covered by water. Because the letter E in contact with the water surface may not be complete, the result of target detection is not accurate enough. Summary of the invention
[0004] The present invention aims to solve the deficiencies of the above-mentioned prior art and proposes a water gauge scale intelligent reading method based on target detection and semantic segmentation, so as to quickly and accurately identify the characters on the water gauge and the water gauge part on the water surface in complex video surveillance scenes, thereby greatly improving the accuracy of water gauge scale reading and solving the problem of water gauge scale reading in video surveillance scenes.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0006] The intelligent reading method of water gauge scale based on target detection and semantic segmentation of the present invention is characterized in that it comprises the following steps:
[0007] Step 1: Collect the water gauge image dataset on the water surface and perform screening and standardization preprocessing to obtain the preprocessed water gauge image dataset X = {X1, ···, X n ,···,X N}, where X n represents the nth water gauge image on the water surface, and N represents the total number of water gauge images;
[0008] Mark X n The number and letter E on it and get X n The corresponding character mask Z n , thus constructing the character mask set Z of X={Z1,···,Z n ,···,Z N};
[0009] Mark X n On the water gauge, and get X n The corresponding water scale mask V n , thus constructing the water scale mask set V = {V1, ···, V n ,···,V N};
[0010] Get the letter E image dataset Y={Y1,···,Y m ,···,Y M}, where Y m represents the mth image of the letter E, where M is the total number of images of the letter E;
[0011] Step 2: Build a water ruler character target detection network based on the yolov7 model, which includes: backbone network, Neck part and Head part:
[0012] Step 2.1: The backbone network is connected to X n Process and output the final activation feature map
[0013] Step 2.2: The Neck part Process and output the nth fusion feature map B n ;
[0014] Step 2.3: The Head part is for B n Process and output the nth water level image X on the water surface n The predicted character mask T n , and then use formula (1) to construct the IOU loss function mask L of the water ruler character target detection network IOU :
[0015]
[0016] Step 3: Build a water-scale semantic segmentation network based on the sam-adapter model, which includes: image encoder and decoder;
[0017] Step 3.1: The image encoder is n Process and output the nth adaptation vector
[0018] Step 3.2: The nth adaptation vector Input to the decoder for decoding operation to obtain X n The predicted water level mask R n ; Thus, the dice loss function L of the water level semantic segmentation network is constructed using formula (2) dice :
[0019]
[0020] Step 4: Build a letter E classification network based on ResNet, which includes: input part, intermediate convolution part, and output part:
[0021] Step 4.1: Take the mth letter E image Y m The input part is subjected to convolution and pooling processing to obtain Y m The shallow feature map G m ;
[0022] Step 4.2: G m After the convolution, downsampling and residual connection operations are performed in the intermediate convolution part, the deep feature map H of the mth letter E image is obtained. m ;
[0023] Step 4.3: H m After global adaptive smooth pooling and linear change processing in the input output part, Y m The predicted classification label probability distribution {P m,u |u=1,2,…,U}, where, P m,u Represents Y m is the probability value of the u-th form of the letter E, and U is the total number of forms of the letter E;
[0024] Step 4.4: Use formula (3) to construct the cross entropy loss function L of the letter E classification network CE :
[0025]
[0026] In formula (3), y m,u Represents the mth letter E image Y m The corresponding u-th true form label;
[0027] Step 5: Based on the water level image sample dataset X = {X1, ···, X n ,···,X N} and the letter E image dataset Y = {Y1, ···, Y m ,···,Y M}, the gradient descent method is used to train the water ruler character target detection network, the water ruler semantic segmentation network and the letter E classification network, and the loss function L is calculated. IOU , L dice and L CE The gradient weights are used to adjust different training parameters, thereby obtaining the trained water ruler character target detection model, water ruler semantic segmentation model and letter E classification model;
[0028] Step 6, the water gauge character target detection model recognizes the numbers and letter E in the water gauge image on the water surface, and outputs the category and position information of the numbers and letter E;
[0029] The water gauge semantic segmentation model segments the water gauge image on the water surface according to the category and position information of numbers and letter E to obtain an accurate mask of the water gauge.
[0030] The letter E classification model recognizes the precise mask of the water gauge to obtain the shape of the letter E on the water gauge that is in contact with the water surface;
[0031] Use formula (4) to calculate the final scale value H of the water gauge:
[0032] H=B±L×0.25 (4)
[0033] In formula (4), B represents the value of the lowest number in the precise mask of the water gauge, and L represents the height of the shape to which the letter E belongs.
[0034] The water gauge scale intelligent reading method based on target detection and semantic segmentation described in the present invention is also characterized in that the backbone network in step 2.1 includes a first CBS module, S MP-1 modules and S+1 ELAN modules;
[0035] Step 2.1.1: Take the nth water level image X n After input into the backbone network, it undergoes convolution, normalization and activation processing of the first CBS module and the first ELAN module in turn to obtain the first activation feature map
[0036] Step 2.1.2: When s=1, The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map.
[0037] Step 2.1.3, when s = 2, 3, ..., S, activate the sth feature map The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map. Thus, the final activation feature map is output by the S+1th ELAN module
[0038] The Neck part in step 2.2 includes the SPPCSPC module, the second CBS module and the first ELAN-W module in sequence;
[0039] Step 2.2.1. After input into the SPPCSPC module for receptive field enlargement, convolution and downsampling, the nth first depth feature map is obtained.
[0040] Step 2.2.2: Input the second CBS module for convolution processing to obtain the nth second depth feature map
[0041] Step 2.2.3: and After splicing, it is input into the first ELAN-W module for channel number change, feature extraction and downsampling operations to obtain the nth fusion feature map B n .
[0042] The Head part in step 2.3 includes the MP-2 module, the second ELAN-W module, the CBM module and the RepConv module in sequence;
[0043] Step 2.3.1. B n After downsampling in the MP-2 module, the nth first pooling feature map is obtained.
[0044] Step 2.3.2: After input into the second ELAN-W module for receptive field enlargement, the nth second pooling feature map is obtained
[0045] Step 2.3.3: Input into the CBM module for processing to obtain the nth semantic feature map D n ;
[0046] Step 2.3.4: D n After inputting into the RepConv module to adjust the number of channels, and then undergoing convolution processing with a convolution kernel of 1×1, the nth water level image X on the water surface is obtained. n The predicted character mask T n .
[0047] The image encoder in step 3.1 includes K sam encoders and K+1 adapters;
[0048] Step 3.1.1, when k = 1, the nth water level image X on the water surface n Input the kth adapter for linear change and activation processing to obtain the kth adaptation vector Will Input the kth sam encoder for encoding and get the kth embedding vector
[0049] Step 3.1.2: When k = 2, 3, ... K, embed the k-1th vector Input to the kth adapter and the kth sam encoder for encoding to obtain the kth embedding vector Thus, the Kth sam encoder outputs the Kth embedding vector
[0050] Step 3.1.3: embed the Kth vector Input into the K+1th adapter for linear transformation and activation processing to obtain the final nth adaptation vector
[0051] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the water gauge scale intelligent reading method, and the processor is configured to execute the program stored in the memory.
[0052] The present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, which is characterized in that when the computer program is run by a processor, the steps of the water gauge scale intelligent reading method are executed.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] 1. The water gauge scale intelligent reading technology proposed in the present invention achieves higher recognition accuracy compared to traditional target detection technology. In traditional target detection, the reflection of the water gauge may cause the detection network to make misjudgments. By applying the water gauge semantic segmentation network, the present invention successfully and accurately segments the water gauge from the background, effectively eliminating the influence of the water gauge reflection on the detection results.
[0055] 2. The present invention further adopts a special letter E classification network to classify and identify the different forms of the letter E in contact with the water surface. Since each form of the letter E corresponds to a specific water level, the method of the present invention achieves accurate reading of the water gauge scale through accurate classification. Compared with previous technologies, the accuracy and reliability of the method of the present invention have been significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1This is a flow chart of intelligent reading of water gauge scale of the present invention;
[0057] Figure 2 The present invention is a specific flow chart of the intelligent reading of the water gauge scale. DETAILED DESCRIPTION
[0058] In this embodiment, a method for intelligently reading water ruler scales based on target detection and semantic segmentation mainly uses a target detection network to first detect the character category and corresponding position information on the water ruler, and then uses a water ruler semantic segmentation network to segment the water ruler part in the water ruler image on the water surface to obtain a complete water ruler image while eliminating the interference of the water ruler reflection on the water ruler character detection, and then uses a letter E segmentation network to obtain the shape of the letter E in contact with the water surface, thereby calculating the scale of the water ruler.
[0059] like Figure 1 As shown, the whole process can be divided into the following steps:
[0060] Step 1: Collect the water gauge image dataset on the water surface and perform screening and standardization preprocessing to obtain the preprocessed water gauge image dataset X = {X1, ···, X n ,···,X N}, where X n represents the nth water gauge image on the water surface, and N represents the total number of water gauge images;
[0061] Mark X n The number and letter E on it and get X n The corresponding character mask Z n , thus constructing the character mask set Z of X={Z1,···,Z n ,···,Z N};
[0062] Mark X n On the water gauge, and get X n The corresponding water scale mask V n , thus constructing the water scale mask set V = {V1, ···, V n ,···,V N};
[0063] Get the letter E image dataset Y={Y1,···,Y m ,···,Y M}, where Y m represents the mth image of the letter E, where M is the total number of images of the letter E.
[0064] Step 2: Build a water ruler character target detection network based on the yolov7 model, which includes: backbone network layer, Neck part and Head part:
[0065] Step 2.1, the backbone network includes the first CBS module, S MP-1 modules and S+1 ELAN modules; in this embodiment, S is 3;
[0066] The first CBS module consists of a convolution layer with a convolution kernel of 3×3 and a stride of 1, a normalization layer BN, and an activation function layer ReLU;
[0067] The ELAN module has two branches. The first branch undergoes a 1x1 convolution to change the number of channels. The second branch first undergoes a 1x1 convolution module to change the number of channels, and then undergoes four 3x3 convolution modules to extract features. Finally, the features of the first and second branches are superimposed to obtain the final feature extraction result.
[0068] The MP-1 module consists of a maximum pooling layer MaxPool, a convolutional layer, a normalization layer, and an activation function layer.
[0069] Step 2.1.1: Take the nth water level image X n The input is sent to the backbone network, passes through the first CBS module and the first ELAN module, and after convolution, normalization and activation, the first activation feature map is obtained.
[0070] Step 2.1.2: When s=1, The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map.
[0071] Step 2.1.3, when s = 2, 3, ..., S, activate the sth feature map The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map. Thus, the final activation feature map is output by the S+1th ELAN module
[0072] Step 2.2, the Neck part includes the SPPCSPC module, the second CBS module and the first ELAN-W module in sequence;
[0073] In this embodiment, the SPPCSPC module is composed of four maximum pooling layers MaxPool with pooling window sizes of 1, 5, 9, and 13 respectively, and 7 convolution modules with 3x3 convolution kernels;
[0074] The second CBS module consists of a convolution layer with a convolution kernel of 3×3 and a stride of 2, a normalization layer BN, and an activation function layer ReLU;
[0075] The first ELAN-W module has two branches. The first branch undergoes a 1x1 convolution to change the number of channels. The second branch first undergoes a 1x1 convolution module to change the number of channels, and then passes through four second CBS modules for feature extraction. Finally, the outputs of the four convolution modules and the output of the first branch are superimposed to obtain the final feature extraction result.
[0076] Step 2.2.1. After input into the SPPCSPC module for receptive field amplification and convolution processing, the nth first depth feature map is obtained.
[0077] Step 2.2.2: Input the second CBS module for convolution processing to obtain the nth second depth feature map
[0078] Step 2.2.3: and After splicing, it is input into the first ELAN-W module for channel number change, feature extraction and downsampling operations to obtain the nth fusion feature map B n .
[0079] Step 2.3, the Head part includes the MP-2 module, the second ELAN-W module, the CBM module and the RepConv module in sequence;
[0080] In this embodiment, the MP-2 module has two branches for downsampling. The first branch first passes through a maximum pooling layer MaxPool, and then passes through a 1x1 convolution to change the number of channels. The second branch first passes through a 1x1 convolution to change the number of channels, and then passes through a convolution block with a convolution kernel of 3x3 and a step size of 2 for downsampling. The outputs of the two branches are then combined through an element-level addition operation to achieve super downsampling and obtain the final downsampling result;
[0081] The second ELAN-W module has two branches. The first branch undergoes a 1x1 convolution to change the number of channels. The second branch first undergoes a 1x1 convolution module to change the number of channels, and then passes through four convolution modules with a 3x3 convolution kernel to extract features. Finally, the outputs of the four convolution modules and the output of the first branch are superimposed to obtain the final feature extraction result.
[0082] The CBM module consists of a convolution layer with a convolution kernel of 1×1 and a stride of 1, a normalization layer BN, and an activation function layer ReLU;
[0083] The RepConv module consists of a depth-wise separable convolutional layer, a normalization layer BN, and an activation function layer ReLU.
[0084] Step 2.3.1. B n After downsampling in the MP-2 module, the nth first pooling feature map is obtained.
[0085] Step 2.3.2: After input into the second ELAN-W module for receptive field enlargement, the nth second pooling feature map is obtained
[0086] Step 2.3.3: Input into the CBM module for processing to obtain the nth semantic feature map D n ;
[0087] Step 2.3.4: D n After inputting into the RepConv module to adjust the number of channels, and then undergoing convolution processing with a convolution kernel of 1×1, the nth water level image X on the water surface is obtained. n The predicted character mask T n ;
[0088] Step 2.3.5: Use formula (1) to construct the IOU loss function mask L of the water ruler character target detection network IOU :
[0089]
[0090] Step 3: Build a water-scale semantic segmentation network based on the sam-adapter model, which includes: image encoder and decoder;
[0091] Step 3.1, the image encoder includes K sam encoders and K+1 adapters; in this embodiment, K is 32; the encoder adopts a Transformer-based architecture, which is composed of multiple sequentially stacked Transformer blocks for feature extraction and encoding of input images; the adapter is composed of two fully connected layers MLP;
[0092] Step 3.1.1, when k = 1, the nth water level image X on the water surface n Input the kth adapter for linear change and activation processing to obtain the kth adaptation vector Will Input the kth sam encoder for encoding and get the kth embedding vector
[0093] Step 3.1.2: When k = 2, 3, ... K, embed the k-1th vector Input to the kth adapter and the kth sam encoder for encoding to obtain the kth embedding vector Thus, the Kth sam encoder outputs the Kth embedding vector
[0094] Step 3.1.3: embed the Kth vector Input into the K+1th adapter for linear transformation and activation processing to obtain the final nth adaptation vector
[0095] Step 3.2: The nth adaptation vector Input to the decoder for decoding operation, and get X n The predicted water level mask R n ; In this embodiment, the decoder consists of a fully connected layer, a convolution layer with a convolution kernel of 3x3, and an activation function layer ReLU.
[0096] Step 3.3: Use formula (2) to construct the dice loss function L of the water level semantic segmentation network dice :
[0097]
[0098] Step 4: Build a letter E classification network based on ResNet, which includes: input part, intermediate convolution part, and output part:
[0099] In this embodiment, the input part consists of a convolution layer with a convolution kernel of 3x3 and a maximum pooling layer MaxPool;
[0100] The middle convolution part consists of three residual blocks;
[0101] The output part consists of a convolution layer with a convolution kernel of 3x3 and a fully connected layer MLP.
[0102] Step 4.1: Take the mth letter E image Y m Convolution and pooling are performed on the input part to obtain Y m The shallow feature map G m ;
[0103] Step 4.2: G m After convolution, downsampling and residual connection operations in the middle convolution part of the input, the deep feature map H of the mth letter E image is obtained.m ;
[0104] Step 4.3: H m After global adaptive smooth pooling and linear change processing in the input output part, Y m The predicted classification label probability distribution {P m,u |u=1,2,…,U}, where, P m,u Represents Y m is the probability value of the u-th form of the letter E, and U is the total number of forms of the letter E;
[0105] Step 4.4: Use formula (3) to construct the cross entropy loss function L of the letter E classification network CE :
[0106]
[0107] In formula (3), y m,u Represents the mth letter E image Y m The u-th element of the true label vector.
[0108] Step 5: Based on the water level image sample dataset X = {X1, ···, X n ,···,X N} and the letter E image dataset Y = {Y1, ···, Y m ,···,Y M}, the gradient descent method is used to train the water ruler character target detection network, the water ruler semantic segmentation network and the letter E classification network, and the loss function L is calculated. IOU , L dice and L CE The gradient weights are used to adjust different training parameters, thereby obtaining the trained water ruler character target detection model, water ruler semantic segmentation model and letter E classification model;
[0109] Step 6: The water gauge character target detection model recognizes the numbers and letter E in the water gauge image on the water surface, and outputs the category and position information of the numbers and letter E;
[0110] The water gauge semantic segmentation model segments the water gauge image on the water surface according to the category and position information of numbers and letter E to obtain an accurate mask of the water gauge.
[0111] The letter E classification model recognizes the precise mask of the water gauge and obtains the shape of the letter E on the water gauge that is in contact with the water surface. The final scale value H of the water gauge is calculated using formula (4):
[0112] H=B±L×0.25 (4)
[0113] In formula (4), B represents the value of the lowest number in the precise mask of the water gauge, and L represents the height of the shape to which the letter E belongs.
[0114] The specific reading process is as follows Figure 2 As shown, including:
[0115] Input the water ruler image on the water surface, first send it to the water ruler character detection model for target detection processing, and obtain the categories of the digital and letter target detection frames on the water ruler image and their coordinate information. Then, according to the coordinate information of the characters with higher confidence, the water ruler part is segmented through the semantic segmentation model of the water ruler to obtain the accurate mask of the water ruler. Then, the characters detected by the water ruler character detection model are filtered, and only the character information within the accurate mask range of the water ruler is left, thereby eliminating the influence of the underwater reflected characters. The remaining digital characters are sorted, and the smallest number is the number closest to the water surface. The letter E classification network is used to determine the letter E shape at the junction of the bottom of the water ruler and the water surface, and finally the final scale of the water surface is calculated by formula (4).
[0116] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0117] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.
Claims
1. A method for intelligent reading of water gauge scale based on target detection and semantic segmentation, characterized in that: The following steps are involved: Step 1: Collect the water gauge image dataset on the water surface and perform screening and standardization preprocessing to obtain the preprocessed water gauge image dataset X = {X1, ···, X n ,···,X N }, where X n represents the nth water gauge image on the water surface, and N represents the total number of water gauge images; Mark X n The number and letter E on it and get X n The corresponding character mask Z n , thus constructing the character mask set Z of X={Z1,···,Z n ,···,Z N }; Mark X n On the water gauge, and get X n The corresponding water scale mask V n , thus constructing the water scale mask set V = {V1, ···, V n ,···,V N }; Get the letter E image dataset Y={Y1,···,Y m ,···,Y M }, where Y m represents the mth image of the letter E, where M is the total number of images of the letter E; Step 2: Build a water ruler character target detection network based on the yolov7 model, which includes: backbone network, Neck part and Head part: Step 2.1: The backbone network is connected to X n Process and output the final activation feature map Step 2.2: The Neck part Process and output the nth fusion feature map B n ; Step 2.3: The Head part is for B n Process and output the nth water level image X on the water surface n The predicted character mask T n , and then use formula (1) to construct the IOU loss function mask L of the water ruler character target detection network IOU : Step 3: Build a water-scale semantic segmentation network based on the sam-adapter model, which includes: image encoder and decoder; Step 3.1: The image encoder is n Process and output the nth adaptation vector Step 3.2: The nth adaptation vector Input to the decoder for decoding operation to obtain X n The predicted water level mask R n ; Thus, the dice loss function L of the water level semantic segmentation network is constructed using formula (2) dice : Step 4: Build a letter E classification network based on ResNet, which includes: input part, intermediate convolution part, and output part: Step 4.1: Take the mth letter E image Y m The input part is convolved and pooled to obtain Y m The shallow feature map G m ; Step 4.2: G m After the convolution, downsampling and residual connection operations are performed in the intermediate convolution part, the deep feature map H of the mth letter E image is obtained. m ; Step 4.3: H m After global adaptive smooth pooling and linear change processing in the input output part, Y m The predicted classification label probability distribution {P m,u |u=1,2,…,U}, where, P m,u Represents Y m is the probability value of the u-th form of the letter E, and U is the total number of forms of the letter E; Step 4.4: Use formula (3) to construct the cross entropy loss function L of the letter E classification network CE : In formula (3), y m,u Represents the mth letter E image Y m The corresponding u-th true form label; Step 5: Based on the water level image sample dataset X = {X1, ···, X n ,···,X N } and the letter E image dataset Y = {Y1, ···, Y m ,···,Y M }, the gradient descent method is used to train the water ruler character target detection network, the water ruler semantic segmentation network and the letter E classification network, and the loss function L is calculated. IOU , L dice and L CE The gradient weights are used to adjust different training parameters, thereby obtaining the trained water ruler character target detection model, water ruler semantic segmentation model and letter E classification model; Step 6, the water gauge character target detection model recognizes the numbers and letter E in the water gauge image on the water surface, and outputs the category and position information of the numbers and letter E; The water gauge semantic segmentation model segments the water gauge image on the water surface according to the category and position information of numbers and letter E to obtain an accurate mask of the water gauge. The letter E classification model recognizes the precise mask of the water gauge to obtain the shape of the letter E on the water gauge that is in contact with the water surface; Use formula (4) to calculate the final scale value H of the water gauge: H=B±L×0.25 (4) In formula (4), B represents the value of the lowest number in the precise mask of the water gauge, and L represents the height of the shape to which the letter E belongs.
2. According to the method of intelligent reading of water gauge scale based on target detection and semantic segmentation in claim 1, it is characterized in that: The backbone network in step 2.1 includes a first CBS module, S MP-1 modules and S+1 ELAN modules; Step 2.1.1: Take the nth water level image X n After input into the backbone network, it undergoes convolution, normalization and activation processing of the first CBS module and the first ELAN module in turn to obtain the first activation feature map Step 2.1.2: When s=1, The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map. Step 2.1.3, when s = 2, 3, ..., S, activate the sth feature map The sth MP-1 module and the s+1th ELAN module are sequentially input for convolution, activation and downsampling to obtain the s+1th activation feature map. Thus, the final activation feature map is output by the S+1th ELAN module 3. According to claim 2, a method for intelligently reading water gauge scales based on target detection and semantic segmentation is characterized in that: The Neck part in step 2.2 includes the SPPCSPC module, the second CBS module and the first ELAN-W module in sequence; Step 2.2.
1. After input into the SPPCSPC module for receptive field enlargement, convolution and downsampling, the nth first depth feature map is obtained. Step 2.2.2: Input the second CBS module for convolution processing to obtain the nth second depth feature map Step 2.2.3: and After splicing, it is input into the first ELAN-W module to change the number of channels, extract features and downsample, and obtain the nth fusion feature map B n .
4. According to claim 3, a method for intelligently reading water gauge scales based on target detection and semantic segmentation is characterized in that: The Head part in step 2.3 includes the MP-2 module, the second ELAN-W module, the CBM module and the RepConv module in sequence; Step 2.3.
1. n After downsampling in the MP-2 module, the nth first pooling feature map is obtained. Step 2.3.2: After input into the second ELAN-W module for receptive field enlargement, the nth second pooling feature map is obtained Step 2.3.3: Input into the CBM module for processing to obtain the nth semantic feature map D n ; Step 2.3.4: D n After inputting into the RepConv module to adjust the number of channels, and then undergoing convolution processing with a convolution kernel of 1×1, the nth water level image X on the water surface is obtained. n The predicted character mask T n .
5. According to claim 4, a method for intelligently reading water gauge scales based on target detection and semantic segmentation is characterized in that: The image encoder in step 3.1 includes K sam encoders and K+1 adapters; Step 3.1.1, when k = 1, the nth water level image X on the water surface n Input the kth adapter for linear change and activation processing to obtain the kth adaptation vector Will Input the kth sam encoder for encoding and get the kth embedding vector Step 3.1.2: When k = 2, 3, ... K, embed the k-1th vector Input to the kth adapter and the kth sam encoder for encoding to obtain the kth embedding vector Thus, the Kth sam encoder outputs the Kth embedding vector Step 3.1.3: embed the Kth vector Input into the K+1th adapter for linear transformation and activation processing to obtain the final nth adaptation vector 6. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the water gauge scale intelligent reading method described in any one of claims 1-5, and the processor is configured to execute the program stored in the memory.
7. 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 water gauge scale intelligent reading method described in any one of claims 1 to 5 are executed.
Citation Information
Cited By
Water level identification method and system based on pre-trained SAM large model
CN119380284A
A water level recognition method and system based on pre-trained SAM large model
CN119380284B
Water level accurate identification method, system and device and storage medium
CN122049877A
