A computer vision-based tailrace air supply system seal state identification method

By using a computer vision-based YOLOv5 network model and attention mechanism, the problem of real-time monitoring of the sealing status of the tailrace air supply system was solved, enabling real-time identification and alarm of the sealing status, thus ensuring the safe and stable operation of the turbine unit.

CN122157097APending Publication Date: 2026-06-05CHINA YANGTZE POWER

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA YANGTZE POWER
Filing Date
2026-02-25
Publication Date
2026-06-05

Smart Images

  • Figure CN122157097A_ABST
    Figure CN122157097A_ABST
Patent Text Reader

Abstract

A tail water pipe air supply system sealing state recognition method based on computer vision, the method comprises collecting unit large shaft images under multiple working conditions, and constructing an image data set; then image preprocessing is completed through adaptive histogram equalization, median filtering, bilateral filtering and RGB- HSV space conversion; then label three types of areas of normal state, trace leakage and obvious water leakage, and divide training set, validation set and test set; then a YOLOv5 model embedded with an improved channel attention mechanism is constructed, the backbone network adopts CSPDarknet structure to extract multi-scale features, the neck network combines FPN and PAN to realize bidirectional fusion of features, and the detection head adopts a decoupling structure to improve positioning and classification accuracy; finally, the pre-training weight fine-tuning model is loaded, the training and verification are completed by using a multi-objective loss function, the real-time and accurate recognition of the sealing state of the tail water pipe air supply system is realized, the equipment fault risk of the unit is effectively reduced, and the method is suitable for the safety monitoring scene of the hydroelectric generating set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of air supply system seal identification technology, specifically relating to a computer vision-based method for identifying the seal status of a tailrace pipe air supply system. Background Technology

[0002] Currently, when a mixed-flow turbine deviates from its optimal operating condition, the tangential velocity of the water flow at the runner outlet increases. The circulation in the water flow causes low pressure to be generated at the center of the draft tube, forming a vortex band. This vortex band swings in a spiral shape, which in turn causes pressure pulsation in the draft tube. This usually also causes a series of problems such as vibration of unit components, shaft oscillation, pressure pulsation in the spiral casing and water intake pipe, and load fluctuation. With long-term operation of the unit, the seal at the end of the air supply pipe is prone to aging and deformation under the influence of factors such as vibration of unit components caused by the draft tube vortex band. Once the seal fails, the draft tube will enter the main shaft, seriously affecting the safe and stable operation of the unit, and may even lead to major equipment failure. The identification of the sealing status of the air supply pipe end of the tailrace pipe of large hydropower units mainly relies on manual inspection. Staff need to enter the turbine room regularly to observe the operation status of the turbine shaft to determine whether there is water splashing, thereby indirectly determining whether the sealing of the air supply pipe end is damaged. However, manual inspection can only be carried out at specific time intervals and cannot achieve real-time monitoring of the sealing status of the air supply pipe end. Therefore, there is an urgent need for a method that uses computer vision technology to monitor and analyze the sealing part of the air supply pipe end in real time, so as to promptly detect potential sealing failures and provide strong support for the maintenance and safe operation of the unit. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a computer vision-based method for identifying the sealing status of the tailrace pipe air supply system. This method can accurately identify deformation, wear and other damage of the sealing parts through image acquisition, processing and recognition algorithms, and promptly detect potential sealing failures, thus providing strong support for the maintenance and safe operation of the unit.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A computer vision-based method for identifying the sealing status of a tailrace pipe air supply system includes the following steps: S1: Collect images of the generator set's main shaft and construct a dataset of images of the generator set's main shaft under multiple operating conditions; S2: Preprocess the image of the main shaft of the generator unit; S3: Label and segment the leaking areas in the image to construct an image annotation dataset; S4: Embed an attention mechanism to build a unit shaft leakage status identification model based on YOLOv5 network; S5: Perform model training and optimization. Learn the leakage features in the image by adjusting hyperparameters, and use the trained model to identify and verify leakage.

[0005] S2 includes: S2.1: Adaptive histogram equalization algorithm is used to improve image contrast, and median filtering and bilateral filtering algorithms are used to suppress image noise; An adaptive histogram equalization algorithm is used to enhance the contrast of the image. The input image of the turbine shaft is divided into several local sub-regions. A gray-level histogram is calculated for each sub-region, and the histogram is cropped. The enhanced pixel values ​​can be represented as follows: (6); In equation (6), Represents the pixel values ​​of the original image. This represents an adaptive mapping function based on a local histogram. Median filtering is used to denoise the image, suppressing random noise caused by oil mist and sensor noise in the shooting environment. The process can be expressed as follows: (7); In equation (7), express The local neighborhood centered on the center; A bilateral filtering algorithm is used to further smooth the image while preserving the structural information of the leak edges. The bilateral filtering considers spatial distance weights and pixel gray-level similarity, and the output result is as follows: (8); In equation (8), This represents the Gaussian weighting function in the spatial domain. This represents the Gaussian weighting function for the grayscale region. This is the normalization factor.

[0006] S2.2: Convert the image from RGB space to HSV space, calculate the maximum and minimum values ​​of R, G, and B in the image, and construct a piecewise nonlinear mapping relationship based on channel differences, and calculate the hue respectively. saturation and brightness Quantity; Among them, the hue component is obtained in the form of a piecewise function, the saturation is determined by the channel difference and the maximum channel value, and the brightness is directly represented by the maximum channel value; By performing the above operations, the influence of changes in lighting is reduced, making the characteristics of the water stand out in stark contrast to the background environment. S2.3: Adopt an adaptive image scaling method, which scales the long side while maintaining the aspect ratio of the image, and minimizes the padding.

[0007] S3 includes: S3.1: Clearly define the different classification standards for water leakage and define the labeling principles for normal conditions, minor leaks, and obvious leaks; S3.2: Use LabelImg software to manually mark the leaking area, including the coordinates of the marked area. ,Width ,high And the category of the labeled area; S3.3: Divide the training set, validation set, and test set into a 7:2:1 ratio.

[0008] S4 includes: S4.1: Construct a unit shaft leakage status identification model based on YOLOv5 network; S4.2: Embed a channel attention mechanism module in the unit shaft leakage status identification model based on YOLOv5 network.

[0009] In S4.1, the unit shaft leakage status identification model based on YOLOv5 network includes a backbone network, a neck network, and a detection head; A YOLOv5 network-based model for identifying unit shaft leakage status receives images. As input, where These represent the image's height, width, and number of RGB channels, respectively. The output of the unit shaft leakage status identification model based on YOLOv5 network includes a tensor containing target location, confidence level, and category information.

[0010] The backbone network adopts the CSPDarknet structure, which consists of a Focus module, a CBS module, and a C3 module. The Focus module achieves downsampling without information loss through slicing operations. The input image is converted from 640×640×3 to four 320×320×12 feature maps: (9); In equation (9): ; The above four sub-feature maps are concatenated along the channel dimension to obtain the output feature map of the Focus module: (10).

[0011] The CBS module consists of a convolutional layer (Conv), a batch normalization layer (BN), and a SiLU activation function, in sequence, and a feature map. Intermediate features are obtained through convolution operations. The convolution process is represented as: (11); In equation (11): For convolution kernel weights, , where i and j represent the row and column indices of the output feature map in the spatial dimension, respectively; m and n represent the position indices of the convolution kernel in the spatial dimension; c and k represent the channel indices of the input and output feature maps, respectively. Convolution output The batch normalization process is as follows: (12); In equation (12): This represents the intermediate feature map output by the convolutional layer. This represents the normalized feature map; and These represent the feature maps in the current mini-batch of samples. Mean and variance in the same channel; It is a smoothing constant; and This represents the learnable scaling and translation parameters; This represents the output feature map after batch normalization and linear transformation. This represents the intermediate feature map output by the convolutional layer. This represents the normalized feature map; and These represent the feature maps in the current mini-batch of samples. Mean and variance in the same channel; It is a smoothing constant; and This represents the learnable scaling and translation parameters; This represents the output feature map after batch normalization and linear transformation. Nonlinear mapping is performed using the SiLU activation function, and its expression is as follows: (13); In equation (13): x These are the feature values ​​after batch normalization. For the Sigmoid function; The above processing enhances the brightness variation and local texture features of the leaking area in the unit's main shaft image.

[0012] The C3 module adopts a cross-stage partial network structure, which splits the input feature map into two parts. The first part is directly used as the shortcut branch, and the second part is sequentially passed through the Bottleneck structure for dimensionality reduction convolution. The outputs of the shortcut branch and the Bottleneck are concatenated in the channel dimension to output intermediate feature maps at multiple scales. The Bottleneck structure uses 1×1 convolution pairs on the input feature map. X The calculation process for channel dimensionality reduction is as follows: (14); Spatial features are then extracted using 3×3 convolution to obtain the output features: (15); Shortcut branch output characteristics Compared with Bottleneck output features When concatenating along the channel dimension, it is represented as: (16); Intermediate feature maps include: Large size 160×160×C1, capable of identifying leaks in small areas; Medium size 80×80×C2 for detecting medium-range water flow areas; The small 40×40×C3 size clearly identifies water leakage.

[0013] The neck network includes an FPN module and a PAN module, and adopts a combination of FPN and PAN structures to realize bidirectional information flow between higher and lower layers; In the multi-scale intermediate feature maps output by the backbone network, the intermediate feature maps with lower resolution and higher number of channels contain more semantic information about the target, describing whether it conforms to the leakage feature; the intermediate feature maps with higher resolution contain more spatial detail information, describing the specific location and size of the leakage feature. The FPN module upsamples the low-resolution intermediate feature maps output by the backbone network to make their spatial dimensions consistent with those of adjacent high-resolution intermediate feature maps, and performs feature fusion at the corresponding scale. This transfers high-level semantic information to the high-resolution feature maps, thereby enhancing the ability to identify minute leaks. (17); In equation (17): This represents the upsampled feature map. Represents high-resolution feature maps, This indicates a feature fusion operation.

[0014] The PAN module reduces the spatial size of high-resolution intermediate feature maps by performing downsampling operations and then fuses them with low-resolution intermediate feature maps of the corresponding scale. This process transfers local spatial detail information from the lower-level intermediate feature maps to the higher-level intermediate feature maps, enabling the higher-level features to retain semantic discriminative ability while possessing richer local detail information. (18); In formula (18): Represents the downsampled feature map. This represents a low-resolution feature map. This indicates a feature fusion operation.

[0015] The neck network ultimately outputs three sets of feature maps at different scales, including: Large feature map 80×80×256, used for detecting small-area leaks; Medium feature map 40×40×512, used to detect water leakage in medium-sized areas; Small feature map of 20×20×1024 is used to detect water leakage over a larger area.

[0016] The detection head adopts a decoupled structure, modeling the classification task and the regression task separately, thereby improving the model's localization accuracy and category discrimination ability for the bounding box of the leaking target; The detection head receives three sets of feature maps at different scales from the output of the neck network. By setting a set of decoupled prediction branches at each scale, including classification and regression branches, and performing parallel convolution modeling on the feature maps at each scale, multi-scale independent prediction is achieved. The output format of the detector head is a multi-scale prediction tensor: (1); In formula (1): This represents the center coordinates and width / height of the predicted bounding box, where 'c' represents the target confidence level. These represent the probabilities of three categories: normal state, minor leakage, and significant leakage, respectively.

[0017] In S4.2, a channel attention mechanism module is embedded in the backbone network; For the input feature map Since the leakage features are sparse in spatial distribution and the channel response signals are weak, they are easily submerged by strong background textures. Therefore, a channel attention mechanism module is embedded in the key feature extraction layer of the YOLOv5 backbone network, namely the output of the C3 module in the backbone network, to improve the model's sensitivity to leakage details. The channel attention module employs an improved SE structure. First, it performs global average pooling on the input feature map X in the spatial dimension to generate channel description vectors. : (2); In equation (2), is the global mean of the c-th channel, representing the channel's response level in the image; Let X represent the feature map of the input feature map X on channel c, where H and W represent the height and width of the input feature map, respectively. Channel description vector In the input two-layer fully connected network, the attention weights of each channel are modeled using a non-linear activation function: (3); In formula (3): s This represents the attention weight for each channel. This represents the weight matrix of the first fully connected layer. , This represents the weight matrix of the second fully connected layer. , z Represents the channel vector. r For channel compression ratio, This represents the ReLU activation function. Represents the Sigmoid function; To further enhance the feature representation capability of the unit shaft leakage status identification model based on YOLOv5 network, an adaptive fusion factor is introduced into the improved SE module. To obtain the proportional relationship between the original features and the weighted features: (4); In equation (4): ; The original feature map is represented by a weighted feature map that retains the overall morphological information of the unit's main shaft and its surrounding structure. ,in a This represents the channel attention weight vector calculated by the SE module, which is used to enhance fine-grained features such as leaking water droplets and water flow trajectories. The leakage status identification model for the unit's main shaft is automatically learned through backpropagation based on a YOLOv5 network. This model is effective when environmental noise is strong or leakage characteristics are ambiguous. Automatically increase the weight of attention; when background information is more critical. Reduce to retain more of the original features.

[0018] S5 includes: S5.1: Use a YOLOv5 model pre-trained on a large-scale dataset as the base model, and fine-tune the training after loading the weights of the model's convolutional layers and feature parameter layers. S5.2: Set the hyperparameters required for training, including epoch, learning rate, batch_size, and set the training optimizer; S5.3: Set the loss function. During the model training phase, a multi-objective loss function is used, defined as: (5); In equation (5), For class loss based on cross-entropy, For bounding box loss based on the CloU loss function, For target confidence loss, This represents the weight value of each loss term; S5.4: Monitor the loss changes and recognition accuracy in real time during training. If the validation set metrics do not improve over a long period, terminate training and adjust the hyperparameters based on the validation results. S5.5: Validate the trained model on the test set, and display the recognition results in the video frame as rectangles and category labels.

[0019] The main beneficial effects of this invention are as follows: 1. Using video footage of the turbine generator shaft obtained solely from monitoring cameras installed in the water turbine room, and based on computer vision technology, real-time detection and alarm of water jetting from the turbine generator shaft are achieved, reducing potential hazards and equipment damage caused by water entering the turbine generator shaft.

[0020] 2. To address the issue of multi-viewpoint and multi-scale issues in the main axis of the generator unit appearing in video sequences, an improved YOLOv5 model based on the attention mechanism is designed to achieve real-time recognition of the main axis of the generator unit. Attached Figure Description

[0021] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This invention provides a sealing status identification process for the unit tailrace air supply system based on YOLOv5. Figure 2 This invention relates to a sealing status identification network for the unit's tailrace pipe air supply system based on YOLOv5. Detailed Implementation

[0022] like Figure 1 As shown, a computer vision-based method for identifying the sealing status of a tailrace pipe air supply system includes the following steps: S1: Collect images of the generator set's main shaft and construct a dataset of images of the generator set's main shaft under multiple operating conditions; S2: Preprocess the image of the main shaft of the generator unit; S3: Label and segment the leaking areas in the image to construct an image annotation dataset; S4: Embed an attention mechanism to build a unit shaft leakage status identification model based on YOLOv5 network; S5: Perform model training and optimization. Learn the leakage features in the image by adjusting hyperparameters, and use the trained model to identify and verify leakage.

[0023] The S1 method uses industrial monitoring cameras deployed in the turbine room to collect images of the turbine generator set's main shaft under different operating conditions, lighting conditions, and unit loads. This covers all operating conditions, including normal operation and start-up / shutdown phases, ensuring the diversity and representativeness of the dataset. It constructs a multi-condition raw dataset of turbine generator set main shaft images to provide sufficient samples for subsequent model training.

[0024] S2 includes: S2.1: Adaptive histogram equalization algorithm is used to improve image contrast, and median filtering and bilateral filtering algorithms are used to suppress image noise; An adaptive histogram equalization algorithm is used to enhance the contrast of the image. The input image of the turbine shaft is divided into several local sub-regions. A gray-level histogram is calculated for each sub-region, and the histogram is cropped. The enhanced pixel values ​​can be represented as follows: (6); In equation (6), Represents the pixel values ​​of the original image. This represents an adaptive mapping function based on a local histogram. Median filtering is used to denoise the image, suppressing random noise caused by oil mist and sensor noise in the shooting environment. The process can be expressed as follows: (7); In equation (7), express The local neighborhood centered on the center; A bilateral filtering algorithm is used to further smooth the image while preserving the structural information of the leak edges. The bilateral filtering considers spatial distance weights and pixel gray-level similarity, and the output result is as follows: (8); In equation (8), This represents the Gaussian weighting function in the spatial domain. This represents the Gaussian weighting function for the grayscale region. This is the normalization factor.

[0025] S2.2: Convert the image from RGB space to HSV space, calculate the maximum and minimum values ​​of R, G, and B in the image, and construct a piecewise nonlinear mapping relationship based on channel differences, and calculate the hue respectively. saturation and brightness Quantity; Among them, the hue component is obtained in the form of a piecewise function, the saturation is determined by the channel difference and the maximum channel value, and the brightness is directly represented by the maximum channel value; By performing the above operations, the influence of changes in lighting is reduced, making the characteristics of the water stand out in stark contrast to the background environment. S2.3: Adaptive image scaling is used to scale the longer side to 640 pixels while maintaining the image aspect ratio, and the shorter side is scaled proportionally and padded to the minimum pixel size. .

[0026] S3 includes: S3.1: Clearly define the different classification standards for water leakage and define the labeling principles for normal conditions, minor leaks, and obvious leaks; S3.2: Use LabelImg software to manually mark the leaking area, including the coordinates of the marked area. ,Width ,high And the category of the labeled area; S3.3: Divide the training set, validation set, and test set into a 7:2:1 ratio.

[0027] S4 includes: S4.1: Construct a unit shaft leakage status identification model based on YOLOv5 network; S4.2: Embed a channel attention mechanism module in the unit shaft leakage status identification model based on YOLOv5 network.

[0028] like Figure 2 As shown in S4.1, the unit shaft leakage status identification model based on YOLOv5 network includes a backbone network, a neck network, and a detection head; A YOLOv5 network-based model for identifying unit shaft leakage status receives images. As input, where These represent the image's height, width, and number of RGB channels, respectively. The output of the unit shaft leakage status identification model based on YOLOv5 network includes a tensor containing target location, confidence level, and category information.

[0029] The backbone network adopts the CSPDarknet structure, which consists of a Focus module, a CBS module, and a C3 module. The Focus module achieves downsampling without information loss through slicing operations. The input image is converted from 640×640×3 to four 320×320×12 feature maps: (9); In equation (9): ; The above four sub-feature maps are concatenated along the channel dimension to obtain the output feature map of the Focus module: (10).

[0030] The CBS module consists of a convolutional layer (Conv), a batch normalization layer (BN), and a SiLU activation function, in sequence, and a feature map. Intermediate features are obtained through convolution operations. The convolution process is represented as: (11); In equation (11): For convolution kernel weights, For bias terms; These represent the row and column indices of the output feature map in the spatial dimension, respectively. This represents the position index of the convolution kernel in the spatial dimension; These represent the channel indices of the input and output feature maps, respectively. Convolution output The batch normalization process is as follows: (12); In equation (12): This represents the intermediate feature map output by the convolutional layer. This represents the normalized feature map; and These represent the feature maps in the current mini-batch of samples. Mean and variance in the same channel; It is a smoothing constant; and This represents the learnable scaling and translation parameters; This represents the output feature map after batch normalization and linear transformation. Nonlinear mapping is performed using the SiLU activation function, and its expression is as follows: (13); In equation (13): x is the feature value after batch normalization. For the Sigmoid function; The above processing enhances the brightness variation and local texture features of the leaking area in the unit's main shaft image.

[0031] The C3 module adopts a cross-stage partial network structure, which splits the input feature map into two parts. The first part is directly used as the shortcut branch, and the second part is sequentially passed through the Bottleneck structure for dimensionality reduction convolution. The outputs of the shortcut branch and the Bottleneck are concatenated in the channel dimension to output intermediate feature maps at multiple scales. The Bottleneck structure uses 1×1 convolution pairs on the input feature map. X The calculation process for channel dimensionality reduction is as follows: (14); Spatial features are then extracted using 3×3 convolution to obtain the output features: (15); Shortcut branch output characteristics Compared with Bottleneck output features When concatenating along the channel dimension, it is represented as: (16); Intermediate feature maps include: Large size 160×160×C1, capable of identifying leaks in small areas; Medium size 80×80×C2 for detecting medium-range water flow areas; The small 40×40×C3 size clearly identifies water leakage.

[0032] The neck network includes an FPN module and a PAN module, and adopts a combination of FPN and PAN structures to realize bidirectional information flow between higher and lower layers; In the multi-scale intermediate feature maps output by the backbone network, the intermediate feature maps with lower resolution and higher number of channels contain more semantic information about the target, describing whether it conforms to the leakage feature; the intermediate feature maps with higher resolution contain more spatial detail information, describing the specific location and size of the leakage feature. The FPN module upsamples the low-resolution intermediate feature maps output by the backbone network to make their spatial dimensions consistent with those of adjacent high-resolution intermediate feature maps, and performs feature fusion at the corresponding scale. This transfers high-level semantic information to the high-resolution feature maps, thereby enhancing the ability to identify minute leaks. (17); In equation (17): This represents the upsampled feature map. Represents high-resolution feature maps, This indicates a feature fusion operation.

[0033] The PAN module reduces the spatial size of high-resolution intermediate feature maps by performing downsampling operations and then fuses them with low-resolution intermediate feature maps of the corresponding scale. This process transfers local spatial detail information from the lower-level intermediate feature maps to the higher-level intermediate feature maps, enabling the higher-level features to retain semantic discriminative ability while possessing richer local detail information. (18); In formula (18): Represents the downsampled feature map. This represents a low-resolution feature map. This indicates a feature fusion operation.

[0034] The neck network ultimately outputs three sets of feature maps at different scales, including: Large feature map 80×80×256, used for detecting small-area leaks; Medium feature map 40×40×512, used to detect water leakage in medium-sized areas; Small feature map of 20×20×1024 is used to detect water leakage over a larger area.

[0035] The detection head adopts a decoupled structure, modeling the classification task and the regression task separately, thereby improving the model's localization accuracy and category discrimination ability for the bounding box of the leaking target; The detection head receives three sets of feature maps at different scales from the output of the neck network. By setting a set of decoupled prediction branches at each scale, including classification and regression branches, and performing parallel convolution modeling on the feature maps at each scale, multi-scale independent prediction is achieved. The output format of the detector head is a multi-scale prediction tensor: (1); In formula (1): This represents the center coordinates and width / height of the predicted bounding box, where 'c' represents the target confidence level. These represent the probabilities of three categories: normal state, minor leakage, and significant leakage, respectively.

[0036] In S4.2, a channel attention mechanism module is embedded in the backbone network; For the input feature map In particular, the reflection of water droplets and thin streams from minute leaks are easily submerged by strong background textures because the leakage features are sparsely distributed in space and the channel response signals are weak. Therefore, a channel attention mechanism module is embedded in the key feature extraction layer of the YOLOv5 backbone network, namely the output of the C3 module in the backbone network, to improve the model's sensitivity to leakage details. The channel attention module employs an improved SE structure. First, it performs global average pooling on the input feature map X in the spatial dimension to generate channel description vectors. : (2); In equation (2), is the global mean of the c-th channel, representing the channel's response level in the image; Let X represent the feature map of the input feature map X on channel c, where H and W represent the height and width of the input feature map, respectively. Channel description vector In the input two-layer fully connected network, the attention weights of each channel are modeled using a non-linear activation function: (3); In formula (3): s This represents the attention weight for each channel. This represents the weight matrix of the first fully connected layer. , This represents the weight matrix of the second fully connected layer. , z Represents the channel vector. r For channel compression ratio, This represents the ReLU activation function. Represents the Sigmoid function; To further enhance the feature representation capability of the unit shaft leakage status identification model based on YOLOv5 network, an adaptive fusion factor is introduced into the improved SE module. To obtain the proportional relationship between the original features and the weighted features: (4); In equation (4): ; The original feature map is represented by a weighted feature map that retains the overall morphological information of the unit's main shaft and its surrounding structure. ,in a This represents the channel attention weight vector calculated by the SE module, which is used to enhance fine-grained features such as leaking water droplets and water flow trajectories. The leakage status identification model for the unit's main shaft is automatically learned through backpropagation based on a YOLOv5 network. This model is effective when environmental noise is strong or leakage characteristics are ambiguous. Automatically increase the weight of attention; when background information is more critical. Reduce to retain more of the original features.

[0037] S5 includes: S5.1: Use a YOLOv5 model pre-trained on a large-scale dataset as the base model, and fine-tune the training after loading the weights of the model's convolutional layers and feature parameter layers. S5.2: Set the hyperparameters required for training, including epoch, learning rate, batch_size, and set the training optimizer; S5.3: Set the loss function. During the model training phase, a multi-objective loss function is used, defined as: (5); In equation (5), For class loss based on cross-entropy, For bounding box loss based on the CloU loss function, For target confidence loss, This represents the weight value of each loss term; S5.4: Monitor the loss changes and recognition accuracy in real time during training. If the validation set metrics do not improve over a long period, terminate training and adjust the hyperparameters based on the validation results. S5.5: Validate the trained model on the test set, and display the recognition results in the video frame as rectangles and category labels.

Claims

1. A method for identifying the sealing status of a tailrace pipe air supply system based on computer vision, characterized in that... Includes the following steps: S1: Collect images of the generator set's main shaft and construct a dataset of images of the generator set's main shaft under multiple operating conditions; S2: Preprocess the image of the main shaft of the generator unit; S3: Label and segment the leaking areas in the image to construct an image annotation dataset; S4: Embed an attention mechanism to build a unit shaft leakage status identification model based on YOLOv5 network; S5: Perform model training and optimization. Learn the leakage features in the image by adjusting hyperparameters, and use the trained model to identify and verify leakage.

2. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 1, characterized in that: S2 includes: S2.1: Adaptive histogram equalization algorithm is used to improve image contrast, and median filtering and bilateral filtering algorithms are used to suppress image noise; S2.2: Convert the image from RGB space to HSV space to reduce the impact of lighting changes and make the water features stand out against the background environment. S2.3: Adopt an adaptive image scaling method, which scales the long side while maintaining the aspect ratio of the image, and minimizes the padding.

3. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 1, characterized in that: S3 includes: S3.1: Clearly define the different classification standards for water leakage and define the labeling principles for normal conditions, minor leaks, and obvious leaks; S3.2: Manually mark the leaking area, including the coordinates of the marked area. ,Width ,high And the category of the labeled area; S3.3: Divide the training set, validation set, and test set into a 7:2:1 ratio.

4. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 1, characterized in that: S4 includes: S4.1: Construct a unit shaft leakage status identification model based on YOLOv5 network; S4.2: Embed a channel attention mechanism module in the unit shaft leakage status identification model based on YOLOv5 network.

5. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 4, characterized in that: In S4.1, the unit shaft leakage status identification model based on YOLOv5 network includes a backbone network, a neck network, and a detection head; A YOLOv5 network-based model for identifying unit shaft leakage status receives images. As input, where These represent the image's height, width, and number of RGB channels, respectively. The output of the unit shaft leakage status identification model based on YOLOv5 network includes a tensor containing target location, confidence level, and category information.

6. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 5, characterized in that: The backbone network adopts the CSPDarknet structure, which consists of a Focus module, a CBS module, and a C3 module. The Focus module achieves downsampling without information loss through slicing operations, transforming the input image from 640×640×3 to a 320×320×12 feature map, thus completing the extraction of edge features of the basic leak area; The CBS module consists of a convolutional layer (Conv), a batch normalization layer (BN), and a SiLU activation function, which enables the extraction of brightness and texture features in the leaking area. The C3 module adopts a cross-stage partial network structure, which splits the input feature map into two parts. The first part is directly used as the shortcut branch, and the second part is sequentially passed through the Bottleneck structure for dimensionality reduction convolution. The outputs of the shortcut branch and the Bottleneck are concatenated in the channel dimension to output intermediate feature maps at multiple scales. Intermediate feature maps include: Large size 160×160×C1, capable of identifying leaks in small areas; Medium size 80×80×C2 for detecting medium-range water flow areas; The small 40×40×C3 size clearly identifies water leakage.

7. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 5, characterized in that: The neck network includes an FPN module and a PAN module, and adopts a combination of FPN and PAN structures to realize bidirectional information flow between higher and lower layers; The FPN module upsamples high-level semantic features from the backbone network and fuses them with mid- and low-level spatial features to enhance the model's ability to recognize small targets. The PAN module passes up the detailed information from the lower layers through downsampling, so that the higher-level features have more local details; The neck network ultimately outputs three sets of feature maps at different scales, including: Large feature map 80×80×256, used for detecting small-area leaks; Medium feature map 40×40×512, used to detect water leakage in medium-sized areas; Small feature map of 20×20×1024 is used to detect water leakage over a larger area.

8. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 5, characterized in that: The detection head adopts a decoupled structure, modeling the classification task and the regression task separately, thereby improving the model's localization accuracy and category discrimination ability for the bounding box of the leaking target; The detection head receives three sets of feature maps at different scales from the output of the neck network and performs target prediction independently at each scale. The output format of the detector head is a multi-scale prediction tensor: (1); In formula (1): This represents the center coordinates and width / height of the predicted bounding box, where 'c' represents the target confidence level. These represent the probabilities of three categories: normal state, minor leakage, and significant leakage, respectively.

9. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 4, characterized in that: In S4.2, a channel attention mechanism module is embedded in the backbone network; For the input feature map Since the leakage features are sparse in spatial distribution and the channel response signals are weak, they are easily submerged by strong background textures. Therefore, a channel attention mechanism module is embedded in the key feature extraction layer of the YOLOv5 backbone network, namely the output of the C3 module in the backbone network, to improve the model's sensitivity to leakage details. The channel attention module employs an improved SE structure. First, it performs global average pooling on the input feature map X in the spatial dimension to generate channel description vectors. : (2); In equation (2), is the global mean of the c-th channel, representing the channel's response level in the image; Channel description vector In the input two-layer fully connected network, the attention weights of each channel are modeled using a non-linear activation function: (3); In formula (3): , , r For channel compression ratio, This represents the ReLU activation function. Represents the Sigmoid function; To further enhance the model's feature representation capabilities, an adaptive fusion factor is introduced into the improved SE module. To obtain the proportional relationship between the original features and the weighted features: (4); In equation (4): ; It is automatically learned through backpropagation of the model. When the environmental noise is strong or the leakage characteristics are unclear, Automatically increase to reinforce attention weight; When background information is more critical Reduce to retain more of the original features.

10. The method for identifying the sealing status of a tailrace pipe air supply system based on computer vision according to claim 1, characterized in that: S5 includes: S5.1: Use a YOLOv5 model pre-trained on a large-scale dataset as the base model, load its weights and then fine-tune the training. S5.2: Set the hyperparameters required for training, including epoch, learning rate, batch_size, and set the training optimizer; S5.3: Set the loss function. During the model training phase, a multi-objective loss function is used, defined as: (5); In equation (5), For class loss based on cross-entropy, For bounding box loss based on the CloU loss function, For target confidence loss, This represents the weight value of each loss term; S5.4: Monitor the loss changes and recognition accuracy in real time during training. If the validation set metrics do not improve over a long period, terminate training and adjust the hyperparameters based on the validation results. S5.5: Validate the trained model on the test set, and display the recognition results in the video frame as rectangles and category labels.