Next Article in Journal
Reconstruction of the Permittivity of Ex Vivo Animal Tissues in the Frequency Range 1–20 GHz Using a Water-Based Dielectric Model
Previous Article in Journal
Deep Learning-Based Transmitter Localization in Sparse Wireless Sensor Networks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Real-Time Intelligent Valve Monitoring Approach through Cameras Based on Computer Vision Methods

1
School of Chemical Engineering, Sichuan University, Chengdu 610065, China
2
China Three Gorges Corporation, Beijing 100038, China
*
Author to whom correspondence should be addressed.
Sensors 2024, 24(16), 5337; https://doi.org/10.3390/s24165337
Submission received: 26 June 2024 / Revised: 8 August 2024 / Accepted: 15 August 2024 / Published: 18 August 2024
(This article belongs to the Section Industrial Sensors)

Abstract

:
Abnormal valve positions can lead to fluctuations in the process industry, potentially triggering serious accidents. For processes that frequently require operational switching, such as green chemical processes based on renewable energy or biotechnological fermentation processes, this issue becomes even more severe. Despite this risk, many plants still rely on manual inspections to check valve status. The widespread use of cameras in large plants now makes it feasible to monitor valve positions through computer vision technology. This paper proposes a novel real-time valve monitoring approach based on computer vision to detect abnormalities in valve positions. Utilizing an improved network architecture based on YOLO V8, the method performs valve detection and feature recognition. To address the challenge of small, relatively fixed-position valves in the images, a coord attention module is introduced, embedding position information into the feature channels and enhancing the accuracy of valve rotation feature extraction. The valve position is then calculated using a rotation algorithm with the valve’s center point and bounding box coordinates, triggering an alarm for valves that exceed a pre-set threshold. The accuracy and generalization ability of the proposed approach are evaluated through experiments on three different types of valves in two industrial scenarios. The results demonstrate that the method meets the accuracy and robustness standards required for real-time valve monitoring in industrial applications.

1. Introduction

In the process industry, valves play a pivotal role in process control, cut-off, regulation, diversion, countercurrent prevention, pressure stabilization, and other functions. In the event of valve failure, negative consequences can arise, including asset loss, production loss due to plant shutdowns, and health, safety, and environmental (HSE) issues [1,2]. For instance, in 1997, a major fire occurred at the Beijing Dongfang Chemical Plant due to workers incorrectly operating valves while unloading light diesel oil, resulting in 9 fatalities, 39 injuries, and direct economic losses amounting to CNY 117 million [3]. Similarly, in 2020, a major explosion at the Dahej Chemical Plant in India occurred due to improper handling of a valve, leading to the release of hazardous chemicals, resulting in 10 fatalities and several injuries [4]. These incidents underscore the paramount importance of mechanical integrity in process safety management, particularly in valve monitoring. In recent years, as countries have begun to pursue low-carbon and green development, the use of renewable energy for hydrogen production, followed by the synthesis of green ammonia, green methanol, and other chemical products, has garnered significant attention. However, due to the volatility of renewable energy sources, the production processes of green ammonia and similar facilities frequently require adjustments in production load. Consequently, the operation of valves becomes more frequent. Therefore, valve monitoring is of paramount importance in chemical production processes based on renewable energy.
In industrial applications, some critical valves are already equipped with detection functions, and there is a body of academic research focused on valve monitoring. However, these studies often focus on control valves [5,6,7], pressure relief valves [8,9], or valve leakage detection [10,11].
Due to the extensive presence of valves throughout the plants of process industry and the limited scope and frequency of routine inspections, timely detection of abnormalities in these valves is often challenging [12,13]. Additionally, the large number of valves and their varying positions in normal conditions make it difficult for inspectors to quickly identify any abnormal changes in valve positions. Although many plants have hundreds of video cameras installed, with most important manual valves within their monitoring range, control rooms can only display a limited number of camera feeds. Human operators cannot simultaneously monitor the status of each valve. Consequently, if a valve experiences an abnormal position due to equipment failure or human error, it is difficult to detect promptly. During this period, the abnormal valve position may affect the normal operation of the equipment. Only when other process variables trigger an alarm do operators use comprehensive judgment to troubleshoot and locate the abnormal valve, which can be time-consuming. This significantly increases maintenance costs, resulting in direct economic losses. If not detected in time, these issues could also lead to serious incidents.
Given these challenges, it is essential to devise an automated method for monitoring abnormal valve positions. Traditional valve position monitoring typically requires significant costs to purchase sensors for each valve and aggregate all sensor signals into a central control system [14,15]. This greatly increases system computation and cost. Over the past decades, the growth of artificial intelligence (AI) has allowed industries to automate and improve their operational efficiency [16,17]. With advancements in computational power and reductions in imaging sensor costs, the use of computer vision methods for hazard detection through ubiquitous cameras in the process industry has become quite mature [18]. Therefore, real-time valve position detection based on cameras has become possible.
Since AlexNet [19] won the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) with its deep convolutional neural network (CNN) model, CNNs have revolutionized computer vision and pattern recognition. Deep CNNs can extract features and classify objects within a single network, learning comprehensive object features to achieve better detection performance. They have been widely used in the fields of process safety monitoring such as fire detection [20,21,22], smoke detection [23,24,25], gas leak detection [26,27,28], and safety helmet detection [29,30,31].
Currently, there have been some reports on computer vision-based valve monitoring research. Li et al. [32] proposed a novel solution with a specific measurement system of the valve opening area that enhances the visibility of valve openings by combining top lighting and camera exposure. A partial image is used to extract the single closed edge of the valve opening. The area computation based on the minimum circumscribed circle and the maximum inner circle of the edge can then be used to identify the valve opening status. However, in practical applications, it is difficult for cameras to capture images of the valve opening. Ahmed et al. [33] proposed an instrumentation valve (IV) status monitoring system based on optical camera communication (OCC). A transmitter circuit with a temperature sensor is integrated into each IV, and a closed-circuit television (CCTV) camera is used to receive data. The valve angle is measured in a cloud server using the data received by the CCTV to determine angle changes due to the proper closing or opening of the instrument valve. Xu et al. [34] proposed a cone valve seal detection method based on the YOLOv3 framework to address the limitations of traditional manual inspection, achieving 95.5% accuracy and a detection speed of 15 images per second. This automated approach enhances efficiency and provides reliable supervision for seal test qualification during cone valve inspection.
Currently, there has been little research on using existing industrial cameras for valve position monitoring. However, some researchers have used computer vision-based methods for knob gear recognition, which is similar to valve position detection. Qin et al. [35] proposed a three-stage knob gear recognition method for substations, utilizing YOLOv4 and Darknet53-DUC-DSNT models to address challenges such as low signal-to-noise ratio, image deformation due to shooting angles, and inconsistent feature distribution. YOLOv4 is employed as the knob area detector, while Darknet53, combined with the DUC and DSNT structures, enhances feature extraction and spatial generalization. This method calculates knob gear angles by analyzing the line from the rotating center point to the pointing point, significantly improving the performance and accuracy of knob gear detection in unattended substations.
Sun et al. [36] proposed a detection model for high-voltage cabinet switch clusters. They utilized EfficientNet-B0 as the backbone network, which is well suited for multi-scale target detection. To enhance the accuracy of small target extraction, they designed a multi-scale feature fusion neck network. This neck network incorporates the concept of the bidirectional cascade (BiC) module from the RepBi-PAN network, omitting the re-parameterization module to improve the real-time performance of the valve switch feature fusion module. Additionally, they developed a valve switch edge capture structure to enhance switch detection accuracy. This method significantly improves the efficiency and accuracy of switch status detection in numerous high-voltage cabinets in substations.
Furthermore, researchers in the field of wind power generation have also employed computer vision methods to identify the rotor blades of wind turbines, which share similarities with the rotational motion trajectories of valves in the chemical industry. Wu et al. [37] developed the YOLOv8-ScConv-WIoU model by incorporating space and channel reconstruction convolution (ScConv) and Wise-IoU (WIoU) loss functions. They demonstrated their model on a self-constructed dataset containing coded labels of different rotation positions and paste positions of the fan rotor. Their method achieved faster convergence, achieved significantly improved accuracy and robustness, and provided new perspectives and insights for the application of other object detection tasks in the industrial field.
In this paper, a real-time valve position monitoring approach based on a computer vision method is proposed. This approach captures minor changes in valve positions in real time identifies them. Its aim is to achieve precise monitoring of valve position changes, thus maximizing the avoidance of potential dangers and accidents. Region-based convolutional neural network (RCNN) is introduced for extracting valve features based on YOLOv8, and a feature pyramid network (FPN) is utilized for feature fusion. Additionally, a coordinate attention (CA) mechanism, tailored to the characteristics of production scenes, is incorporated to embed position information into feature channels for the more accurate extraction of valve rotation features. Finally, a rotation algorithm is employed to calculate the valve position using the coordinates of the valve’s bounding box.

2. Methods

2.1. Framework

The proposed intelligent valve monitoring approach is depicted in Figure 1, consisting of three primary steps. Initially, images of valves and their surrounding environments are captured using industrial-grade cameras, forming a dataset for the YOLO model utilized in valve monitoring. Subsequently, real-time image data are processed frame by frame through the YOLO model, facilitating the extraction of edges, corners, and fundamental texture features of the valves. Finally, the valve position is determined by calculating the rotation angle of the valve based on the extracted features. If the calculated angle exceeds a predefined threshold, indicating an anomaly, an alarm is triggered.

2.2. Dataset Process

For the collected valve images in industrial scenarios, the initial step involves annotating and classifying the valves. This annotation process, as demonstrated in Figure 2, entails providing the model with the boundary box marked with the green box in the figure, inclusive of the coordinates and angles of the four corners, as well as valve category information. To ensure standardized and consistent angle information, valves of the same category are rotated clockwise based on the horizontal direction to align with the valve rotation angle. These details are critical for the angle calculation results and subsequent model input. For partially obscured or circular-shaped valves, specific markings are created beforehand to facilitate the effective extraction of valve position characteristics, thereby aiding in more accurate calculations of the valve’s rotation degree. Further details on specific markings are provided in Section 3.2. Additionally, although the training data were acquired under optimal lighting conditions, brightness adjustment preprocessing was applied to some images prior to training. This approach enhances the model’s adaptability to varying lighting conditions.

2.3. Valve Feature Extraction by YOLO V8

The valve feature extraction model proposed in this paper is based on structural adjustments from YOLO V8, as illustrated in Figure 3.
It includes feature extraction based on regional convolutional neural networks (RCNNs), small target feature enhancement using the coord attention (CA) mechanism, and multi-scale feature fusion employing the feature pyramid network (FPN). Taking frame-by-frame images from real-time factory monitoring as the input, the feature extraction step leverages a deep convolutional layer network to identify features such as edges, corners, and basic textures. The CA attention mechanism is integrated to enhance small target features in small-scale feature maps. After feature extraction, multi-scale feature maps undergo fusion in the FPN to improve the model’s ability to detect targets of varying sizes. Finally, the model predicts bounding boxes and category confidence through a decoupled head and calculates the valve opening using rotation calculations.

2.3.1. Feature Extraction

The overall framework of the feature extraction step, based on regional convolutional neural networks (RCNNs), is shown in the backbone section of the YOLO framework in Figure 4. The backbone receives the input image tensor with dimensions (h_in, w_in, c_in) and processes it to extract meaningful features for object detection.
The backbone is primarily composed of convolutional layers (conv) and residual blocks. The design incorporates ideas from VGG and network-in-network architectures, enhancing feature extraction by increasing the number of channels in the network. This approach maintains the receptive field while reducing computational load, resulting in a design that is lightweight, flexible, and scalable.
The structure of the C2f residual module is illustrated in Figure 4. The main purpose of the residual link is to mitigate the gradient vanishing problem, which can occur as the number of layers increases, ensuring that the input features are effectively propagated to the deeper layers of the network. In addition to the traditional CSP structure, the C2f module includes more layer-hopping connections, removes the convolution operation in the branches, and incorporates a split operation to enrich the feature information and reduce computational effort.
The C2f module first convolves the input tensor (h_in, w_in, c_in), then splits it into two tensors (h_in, w_in, c_out). One of these tensors passes directly through n bottlenecks, while the other is concatenated with half of the output from each bottleneck layer (h_in, w_in, 0.5c_out). Finally, the residuals of (h_in, w_in, 0.5c_out) are connected. The concatenated result (h_in, w_in, 0.5 (n+2) c_out) is then output after an additional convolution operation.

2.3.2. Feature Enhancement

Small targets, like valves in the plants, often present challenges in detection due to their limited representation in high-resolution images. To address this issue, a small target feature enhancement step based on the CA mechanism is performed. Specifically, after the SPPF layer in the feature extraction stage, the CA was incorporated, which plays a crucial role in enhancing the detection performance of small targets [38]. The overall framework of the CA mechanism is shown in Figure 5.
The CA module operates by receiving input feature map tensors with dimensions (h_in, w_in, c_out). In addition to these input tensors, positional information is incorporated in the form of positional encoding vectors. These vectors are appended to the channel dimension of the input feature map tensors, effectively embedding positional information within the channel attention mechanism.
Upon embedding positional information, the CA module proceeds with the decomposition of channel attention into two distinct encoding processes. Firstly, a global encoding process aggregates features along one spatial direction, capturing global information and long-range dependencies. Secondly, a positional encoding process preserves accurate positional information along another spatial direction, ensuring the precise localization of targets.
The output of the CA module consists of enhanced feature map tensors that capture cross-channel information while simultaneously incorporating direction-aware and position-aware information. Notably, the CA module does not alter the number of channels for the original features; it merely augments the positional information. By embedding positional information within the channel attention mechanism, the CA module effectively amplifies the model’s attention towards small target features, ultimately resulting in improved detection accuracy.

2.3.3. Feature Fusion and Prediction

As shown in Figure 3, the CA-enhanced feature fusion is fed into the FPN, where feature maps of different scales are fused to enable the network to capture small and large objects in the image simultaneously. This fusion approach helps the network better address the issue of scale variation in object detection tasks. Then, a decoupled head structure is used to separate classification from regression in the head section. The feature pyramid undergoes up- and down-sampling to produce feature maps at various scales, and independent detectors are then assigned to each of these feature maps. These feature maps are crucial for detecting objects of varying sizes and aspect ratios.
Then, each scale of the feature map is processed independently by detectors assigned to it. These detectors predict bounding boxes and categories. This approach effectively captures target information across different scales, enhancing the accuracy of target detection. Each detector consists of a set of convolutional and fully connected layers, with different numbers of channels being assigned to the classification branch and the regression branch, focusing on the fact that they characterize different features. Firstly, the valve type is identified through the classification task. In the regression task, the strategy used by the model is mainly based on the center approach, i.e., first finding the center/center region, then predicting the distance from the center to the four edges and regressing the bounding boxes of the valve and the coordinates of the four corners.

2.4. Valve Position Calculation

After the preliminary steps, the valve frame is extracted, and then the rotation angle of the valve, i.e., the valve position, can be calculated based on the precise coordinates of the four corners of the frame. By comparing the valve position with that under normal operating conditions, if the threshold is not met, it is considered as an abnormal valve condition, and an alarm will be triggered [39]. An 8-parameter description is used for the input rotating frame based on the four vertices of the frame, i.e., x1, y1, x2, y2, x3, y3, x4, y4. However, a 5-parameter description, i.e., cx, cy, w, h, θ, is used for the loss calculation and output, as shown in Figure 6.
Calculate the angle θ between the rotating frame and the x-axis:
θ = arctan x 2 x 1 , y 2 y 1
The center point is calculated as:
c x , c y = 1 4 i = 1 4 x i , 1 4 i = 1 4 y i
First, rotate the rotation box through the angle to obtain the horizontal box, and then calculate the extreme value of the left and right sides of the horizontal box to obtain the length and width value as shown in Figure 7.
To calculate the coordinates of A, as shown in the figure, β = 90 − θ is the rotation angle, and d is the distance from the center point to A.
x = d sin β + γ = x cos β + y sin β
y = d cos β + γ = y cos β x sin β
The regressed rotation angle is compared with a pre-set normal threshold to monitor abnormal valve positions. In this paper, an abnormality in the valve position is defined as the rotation angle deviates from the specified correct angle range:
abnormal degree = θ p r e d θ n o r m a l _ u p p e r θ n o r m a l _ u p p e r × 100 % i f θ p r e d > θ n o r m a l _ u p p e r θ p r e d θ n o r m a l _ l o w e r θ n o r m a l _ l o w e r × 100 % i f θ p r e d < θ n o r m a l _ l o w e r 0 e l s e
where θpred is the valve position predicted by the regression; θnormal_upper and θnormal_lower are the upper and lower limits of the normal threshold of the valve, respectively.

3. Experiments

3.1. Experiment Design

The experiment was designed based on the industrial equipment at the practical training base of the School of Chemical Engineering at Sichuan University. To better reflect actual chemical industry production scenarios, Canon EOS 200D II camera purchased in Chengdu, China was mounted diagonally above the equipment to collect images at a speed of 25 frames per second. The captured frames were then transmitted to the monitoring model for recognition.
For each scenario, an independent camera was set up. To objectively evaluate the practical performance of this method, the following conditions of actual industrial scenarios were considered during the experimental design:
(1)
The camera perspective was set diagonally above the experimental equipment, simulating an industrial surveillance scenario.
(2)
The experimental scenario incorporated valves of different types, primarily with varying exterior appearances.
(3)
Scenarios were designed to assess the impact of different lighting conditions on detection.
(4)
Scenarios were also created to investigate the effects of valve obstruction on detection.

3.2. Dataset

To ensure the general applicability of the method to different valves in various scenarios, experiments involving different equipment setups, valve types, and numbers of valves were designed to simulate monitoring conditions at different locations in the plants. In this experiment, three different valve categories were considered, as shown in Figure 8. Based on their appearance, they are named as handwheel valves, lever valves, and knob valves. Two sets of datasets for the experiments were obtained, as shown in Table 1. In each dataset, the images were randomly divided into training, validation, and testing sets at a ratio of 7:2:1.
YOLOv8’s efficient backbone network and versatile anchor-free detection head facilitate the feasibility of training the model on a small sample dataset. Additionally, in the industrial application context of valves, the monitored valve’s type, position, and angle of view exhibit relative consistency, rendering the currently established dataset size as adequate for supporting the training process.
As shown in Figure 9, the scenario of Dataset 1 mainly involves the gas phase pipeline valves of two storage tanks. It includes two handwheel valves and two lever valves on the gas phase inlet and outlet pipelines on the top of the tank.
The handwheel valve has a standard circular shape and is divided into eight equal parts. Thus, every 45° of rotation makes the valve appear identical to its original position, complicating the accurate identification of the actual position. As illustrated in Figure 10, markers were added to the valve to facilitate the precise extraction of boundaries and the calculation of the rotation angle, thereby enabling an accurate determination of the valve position.
As depicted in Figure 11, the scenario of Dataset 2 primarily involves six knob valves in a set of parallel pipelines. Due to the close arrangement of pipelines and the limited camera angle coverage, one of the valves is obscured. The unobstructed valve is named knob1, while the obstructed valve is named knob2. Preprocessing with markers was performed for the obstructed valve, as shown in Figure 12.
Although the training data were obtained under optimal lighting conditions, brightness adjustment was applied to some images before training. This approach allows the trained model to adapt effectively to different lighting conditions. In this study, 80 sets of test samples were established by adjusting the lights to 10–100% during nighttime in Scenario 2, aiming to test the model performance under varying lighting conditions.
Despite the initial human intervention required for valve preprocessing and brightness adjustment, this approach is more user-friendly for industrial applications compared with adding sensors or using more complex algorithms. It is characterized by its ease of operation, cost-effectiveness and does not affect the detection accuracy. The subsequent experimental results demonstrated the effectiveness of these preprocessing methods.

3.3. Model Training

The training environment for our model is NVIDIA RTX 4060 GPU using Python (3.8) and PyTorch (1.13.1 + cu117). Training was conducted for 300 epochs with a learning rate of 0.01. The training metrics of the model are shown in Figure 13.
Precision and recall are critical metrics for algorithm evaluation. In classification tasks, class precision is the number of true positives divided by the total number of elements predicted and labeled as positive. Recall is the number of true positives divided by the total number of elements that actually belong to the positive class. Typically, there is an inverse relationship between precision and recall, where increasing one often reduces the other. By calculating precision and recall for different thresholds, a precision–recall (P–R) curve can be plotted, showing precision as a function of recall.
Precision = true positive true positive + false positive
Recall = true positive true positive + false negative
The PR curve (Figure 13a) represents the precision and recall rate of the five recognized targets with an IoU threshold of 0.5. The average precision (AP) represents the area under the PR curve for each category.
AP = 0 1 P R dR
The mean average precision (mAP) denotes the average of the AP of all recognized classes. The mAP is calculated as follows:
mAP = 1 N i = 1 N AP i
Figure 13b shows the variation in mAP values during training. The mAP reaches above 0.85 after the 160th epoch. mAP50:95 (the average mAP for different IoU thresholds from 0.5 to 0.95) also reaches around 0.61 at the end of the iteration.
The F1-score (depicted in Figure 13d) is a crucial metric that balances accuracy and recall, providing a comprehensive evaluation of the classifier’s performance in our valve angle position detection task. Its value ranges from 0 to 1, with 1 representing a perfect classifier and 0 indicating the worst possible performance. In our dataset, the F1-score achieved is approximately 0.98, demonstrating the exceptional performance of the model.
F 1 = 2 × ( P r e c i s i o n × R e c a l l ) P r e c i s i o n + R e c a l l
All of these metrics demonstrate the effectiveness of the real-time valve knob opening monitoring scheme and show the method’s excellent performance in detecting the opening of multiple valve categories.
The BCE loss, DFL loss, and ProbIoU loss functions were weighted with certain proportions to obtain the final loss [40]. The loss stabilized after approximately 250 epochs (Figure 13c), indicating that 300 epochs were sufficient for training.

4. Result and Analysis

4.1. Model Evaluation Criteria

To objectively evaluate the detection performance of the method, the mean relative error (MRE) is introduced to analyze the detection results, as shown in the following equation:
MRE = 1 N D p r e d D a c t u a l D a c t u a l × 100 %
where Dpred represents the opening angle of the valve predicted by the model, Dactua represents the actual angle of the valve, and N is the number of testing samples. A lower MRE indicates closer alignment with the true value.
Another metric, frames per second (FPS), indicates how many frames a model can process in one second. As a general industry standard for real-time computer vision-based inspection, an average FPS of 30 frames or more is required to meet real-time requirements.
To ensure the accuracy of anomaly monitoring, the false alarm rate and the missed alarm rate were calculated. False alarms occur when rotational angles within the alarm range are not within the specified normal thresholds; missed alarms occur when the rotation angle is not within the specified normal opening thresholds but alarms are not raised. The definitions are shown below:
False alarm probability:
P FP = P Predict alarm Actual normal
False alarm probability:
P FN = P Predict normal Actual alarm

4.2. Results of Valves under Normal Conditions

Figure 14 shows the monitoring results of the model under Scenario 1 and Scenario 2. The model accurately identifies the valve and detects the opening of the valve regardless of the scenario. When the valve position exceeds the threshold range, the color of the valve anchor box changes from green to red as an alarm indicator.
As shown in Table 2, the mean relative error (MRE) for all three types of valves is less than 12%, with an average of approximately 8%. This indicates that the method demonstrates excellent performance and a high degree of accuracy in detecting valve openness. Based on this, further determinations were performed to identify whether valves are in an abnormal state and to trigger alarms. The results show that the average false alarm rate of the model ranges from approximately 0.4% to 0.7%, and the missed alarm rate is around 0.2% to 0.8%, meeting the accuracy requirements for early warning systems in practical industrial production environments. Among the valve types, the model performs best in monitoring handwheel valves. Additionally, during the model training phase, the detection time of the proposed method is only 12.4 ms, and the FPS reaches up to 80, fully meeting the real-time requirements of industrial applications.

4.3. Experiment under Obscured Conditions

In Scenario 2, the monitoring effectiveness of the model was tested when valves are obscured by equipment or pipes. Following the preprocessing steps outlined in Figure 12 of Section 3.2, identifiers were set for valves that were obstructed in the camera view. Ensuring that the identifiers were fully exposed to the camera, the model was then used to detect changes in the rotation of these identifiers, representing the opening size of the valve knob. These identifiers, together with the valves, are treated as specific valves, and the introduction of these identifiers does not alter the essence of the detection process. Part of the detection effect is shown in Figure 15. Because the obstructed valves and their identifiers are treated as special valves, the model successfully detected them, and the angle values fell within a reasonable range.
The experimental results, summarized in Table 3, indicate that the detection accuracy for both obstructed and unobstructed valves is above 0.98. In this scenario, the average false alarm rate and omission rate are approximately 6.00 × 10−3. Interestingly, the detection accuracy for obstructed valves was even higher than for regular unobstructed valves. This demonstrates that, despite the valves being obstructed, adding markers ensures that the state of the valves is clearly identified. If the features added to the markers are distinct, it can even enhance the detection effect. The results presented in Section 4.2 also suggest that the handwheel valve with an added identifier exhibits higher detection accuracy among all valve types. The preprocessing method of adding identifiers proposed in this study provides a new approach for industrial application-level detection methods.

4.4. Model Evaluation Criteria

The experiment regarding lighting conditions was designed based on Scenario 2. Training samples were collected under normal lighting conditions, and their brightness was randomly multiplied by 0.1–1.8 times through preprocessing for model training. The test samples were monitored under different real-world lighting intensities. As shown in Figure 16, the model can accurately identify valves and monitor valve positions under normal, excessively bright, or excessively dark conditions. Detailed results are presented in Table 4, indicating that the detection accuracy of valve positions with and without occlusion is above 0.97, and the false alarm rate and missed alarm rate are less than 1%. The findings reveal that detection accuracy considering different lighting conditions is slightly lower than under stable lighting, and the false alarm and missed alarm rates are slightly higher. This may be due to the blurring of valve boundaries and features when lighting changes are too drastic. However, the overall performance is better than models trained only on normal lighting samples without brightness preprocessing before training. This demonstrates that the proposed brightness preprocessing strategy enhances the model’s robustness and resistance to external lighting changes.

4.5. Results Comparison

To further elucidate the effectiveness of the proposed method, particularly the benefits of incorporating the CA mechanism, a comparative analysis was conducted with the YOLOv8n OBB model, YOLOv8x OBB model, and YOLOv9e OBB model. The results of this comparison are presented in Table 5.
As shown in Table 5, among the original YOLO series models, the YOLOv8n OBB model exhibits superior performance. The proposed model introduces the CA attention mechanism based on the original YOLOv8n OBB model framework. It demonstrates improvements in accuracy, recall, and average accuracy by 0.9%, 1.7%, and 1.1%, respectively. The introduction of the CA attention mechanism enhances the model’s ability to capture details, thereby improving its accuracy and performance while maintaining real-time processing capabilities. Certainly, the introduction of the CA module results in a higher computational cost. This is reflected in the FPS metric, where the original YOLOv8n OBB model achieves an FPS of 91, while the proposed model achieves an FPS of 80, which is 11 frames per second lower.
During the training process, the relationship between the mAP50 curve and the validation set loss function (val_loss) across different schemes and numbers of iterations is illustrated in Figure 17.
As shown in Figure 17, with an increasing number in training rounds, the val_loss for each scheme gradually decreases and stabilizes. Concurrently, mAP50 increases and stabilizes, indicating that the detection ability of each model improves over time. The convergence rates for the two models are similar, demonstrating that the proposed model is stable and effective.

4.6. Discussion and Prospects

Despite demonstrating practical efficacy and achieving excellent results, the proposed method still exhibits certain limitations. Specifically, for handwheel valves, our method can sensitively detect whether the current valve angle state is within the correct range, regardless of whether the rotation angle is less than or greater than 360 degrees. However, our research at this stage has somewhat overlooked the rotation of precisely 360-degree multiples of the correct angle range, that is, the rotation immediately after returning to the correct angle position. While the likelihood of this situation occurring after misoperation is minimal in real production processes, one potential solution is to incorporate markers that can reflect valve rotation exceeding one full revolution, such as markers linking the valve disc and the tank or valve core. We aim to address this issue more comprehensively in the next stage of our work. Currently, we utilize a camera with a fixed view angle as a visual sensor. In the future, we plan to explore the detection of varying view angles and mitigate the potential impact of differences in view angle.

5. Conclusions

Abnormal valve positions can significantly impact the normal operation of equipment, posing substantial risks to the stable functioning of process industry plants. This paper proposes a novel computer vision-based valve position monitoring approach. Utilizing image data collected from cameras, the method identifies and detects valve positions in real-time and issues alarms for abnormal valves. The practicality and accuracy of the proposed method have been verified through actual industrial scenarios. The main conclusions are summarized as follows:
(1)
A real-time intelligent valve monitoring approach based on computer vision is introduced, incorporating the CA attention mechanism into the YOLOv8 framework to accommodate the characteristics of production scenarios.
(2)
The model has been extensively tested on various types of valves, demonstrating its reliability across most prevalent valve types currently in use.
(3)
Effective strategies are proposed and experimentally validated to manage scenarios involving obscured valves and varying lighting conditions.
The proposed method facilitates the low-cost, high-efficiency real-time monitoring of critical valve states in process industry plants, thereby significantly reducing operational risks and enhancing process safety management. Future integration of this method into advanced equipment, such as inspection robots, handheld terminals, and high-point cameras, is anticipated to enable more extensive and flexible industrial applications.

Author Contributions

Conceptualization, Z.Z. and Q.Z.; methodology, Z.Z.; software, Q.Z.; validation, Z.Z. and Q.Z.; formal analysis, Z.Z.; investigation, Q.L.; resources, H.J.; data curation, Z.Z.; writing—original draft preparation, Z.Z. and Q.Z.; writing—review and editing, Y.D.; visualization, Z.Z.; supervision, Q.L.; project administration, Y.D.; funding acquisition, Y.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Key Research and Development Program of China (2021YFB4000505).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding authors. The data are not publicly available due to privacy restrictions.

Acknowledgments

The authors extend their gratitude to the Excellent Engineers Center of Sichuan University for providing the experimental environment and for their invaluable support.

Conflicts of Interest

The authors Heping Jin and Qian Li are employed in China Three Gorges Corporation. The other authors declare no conflicts of interest.

References

  1. Sotoodeh, K.; Gudmestad, O.T. Safety and reliability improvement of valves and actuators in the offshore oil and gas industry. Life Cycle Reliab. Saf. Eng. 2022, 11, 293–302. [Google Scholar] [CrossRef]
  2. Yu, J.; Yi, J.; Mahgerefteh, H. Optimal emergency shutdown valve configuration for pressurised pipelines. Process Saf. Environ. Prot. 2022, 159, 768–778. [Google Scholar] [CrossRef]
  3. Wang, B.; Li, D.; Wu, C. Characteristics of hazardous chemical accidents during hot season in China from 1989 to 2019: A statistical investigation. Saf. Sci. 2020, 129, 104788. [Google Scholar] [CrossRef]
  4. Megaraj, M.; Dillibabu, S.P.; Durvasulu, R.; Manjunathan, K.; Palanivel, A.; Vasudevan, B.; Grace, N. Post lockdown industrial accidents and their safety ontology. In AIP Conference Proceedings; AIP Publishing: Long Island, NY, USA, 2023. [Google Scholar]
  5. Sun, F.; Xu, H.; Meng, Y.; Yin, H. A novel multi-view enhanced visual detection for cavitation of control valve. Chem. Eng. Res. Des. 2023, 195, 673–681. [Google Scholar] [CrossRef]
  6. Memarian, A.; Damarla, S.K.; Huang, B. Control valve stiction detection using Markov transition field and deep convolutional neural network. Can. J. Chem. Eng. 2023, 101, 6114–6125. [Google Scholar] [CrossRef]
  7. Akavalappil, V.; Radhakrishnan, T.K.; Dave, S.K. A convolutional neural network (CNN)-based direct method to detect stiction in control valves. Can. J. Chem. Eng. 2023, 101, 3963–3981. [Google Scholar] [CrossRef]
  8. Cao, J.; Zhang, J.; Yu, X.; Tu, S.-T. Detection of pressure relief valve leakage by tuning generated sound characteristics. Process Saf. Environ. Prot. 2021, 148, 664–675. [Google Scholar] [CrossRef]
  9. Hou, J.J.; Li, S.X.; Yang, L.X.; Zhang, X.D.; Zhao, Q. Multi-leakage source localization of safety valve based on improved KDE algorithm. Process Saf. Environ. Prot. 2023, 171, 493–506. [Google Scholar] [CrossRef]
  10. Liu, M.; Lang, X.; Li, S.; Deng, L.; Peng, B.; Wu, Y.; Zhou, X. Improved machine learning leak fault recognition for low-pressure natural gas valve. Process Saf. Environ. Prot. 2023, 178, 947–958. [Google Scholar] [CrossRef]
  11. Ye, G.-Y.; Xu, K.-J.; Wu, W.-K. Multivariable modeling of valve inner leakage acoustic emission signal based on Gaussian process. Mech. Syst. Signal Process. 2020, 140, 106675. [Google Scholar] [CrossRef]
  12. Peyvan, D.; Buchmann, B. Precision in valve position indication. Nucl. Eng. Int. 2001, 46, 28–29. [Google Scholar]
  13. Bacci di Capaci, R.; Scali, C. Stiction Quantification: A Robust Methodology for Valve Monitoring and Maintenance Scheduling. Ind. Eng. Chem. Res. 2014, 53, 7507–7516. [Google Scholar] [CrossRef]
  14. Aranha, P.E.; Lopes, L.; Paranhos Sobrinho, E.; Oliveira, I.d.M.N.; de Araújo, J.; Santos, B.B.d.; Lima Junior, E.; da Silva, T.; Vieira, T.; Lira, W.W.M. A System to Detect Oilwell Anomalies Using Deep Learning and Decision Diagram Dual Approach. SPE J. 2024, 29, 1540–1553. [Google Scholar] [CrossRef]
  15. Liu, J.; Yuan, C.; Matias, L.; Bowen, C.; Dhokia, V.; Pan, M.; Roscow, J. Sensor Technologies for Hydraulic Valve and System Performance Monitoring: Challenges and Perspectives. Adv. Sens. Res. 2024, 3, 2300130. [Google Scholar] [CrossRef]
  16. Venkatasubramanian, V. The promise of artificial intelligence in chemical engineering: Is it here, finally? Aiche J. 2019, 65, 466–478. [Google Scholar] [CrossRef]
  17. Arunthavanathan, R.; Sajid, Z.; Amin, M.T.; Tian, Y.; Khan, F.; Pistikopoulos, E. Process safety 4.0: Artificial intelligence or intelligence augmentation for safer process operation? Aiche J. 2024, 70, e18475. [Google Scholar] [CrossRef]
  18. Dai, Y.; Wang, H.; Khan, F.; Zhao, J. Abnormal situation management for smart chemical process operation. Curr. Opin. Chem. Eng. 2016, 14, 49–55. [Google Scholar] [CrossRef]
  19. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet Classification with Deep Convolutional Neural Networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef]
  20. Wu, H.; Wu, D.; Zhao, J. An intelligent fire detection approach through cameras based on computer vision methods. Process Saf. Environ. Prot. 2019, 127, 245–256. [Google Scholar] [CrossRef]
  21. Huang, P.; Chen, M.; Chen, K.; Zhang, H.; Yu, L.; Liu, C. A combined real-time intelligent fire detection and forecasting approach through cameras based on computer vision method. Process Saf. Environ. Prot. 2022, 164, 629–638. [Google Scholar] [CrossRef]
  22. Mun, J.; Kim, J.; Do, Y.; Kim, H.; Lee, C.; Jeong, J. Design and Implementation of Defect Detection System Based on YOLOv5-CBAM for Lead Tabs in Secondary Battery Manufacturing. Processes 2023, 11, 2751. [Google Scholar] [CrossRef]
  23. Zhou, H.; Cong, H.; Wang, Y.; Dou, Z. A computer-vision-based deep learning model of smoke diffusion. Process Saf. Environ. Prot. 2024, 187, 721–735. [Google Scholar] [CrossRef]
  24. Zhang, P.; Song, Z.; Li, C.; Liu, Y.; Zou, Y.; Zhang, Y.; Sun, P. A study of engine room smoke detection based on proactive machine vision model for intelligent ship. Expert Syst. Appl. 2024, 241, 122689. [Google Scholar] [CrossRef]
  25. Wang, X.; Wang, J.; Chen, L.; Zhang, Y. Improving Computer Vision-Based Wildfire Smoke Detection by Combining SE-ResNet with SVM. Processes 2024, 12, 747. [Google Scholar] [CrossRef]
  26. Hu, S.; Feng, A.; Shi, J.; Li, J.; Khan, F.; Zhu, H.; Chen, J.; Chen, G. Underwater gas leak detection using an autonomous underwater vehicle (robotic fish). Process Saf. Environ. Prot. 2022, 167, 89–96. [Google Scholar] [CrossRef]
  27. Shi, J.; Chang, Y.; Xu, C.; Khan, F.; Chen, G.; Li, C. Real-time leak detection using an infrared camera and Faster R-CNN technique. Comput. Chem. Eng. 2020, 135, 106780. [Google Scholar] [CrossRef]
  28. Song, Y.; Li, S. Gas leak detection in galvanised steel pipe with internal flow noise using convolutional neural network. Process Saf. Environ. Prot. 2021, 146, 736–744. [Google Scholar] [CrossRef]
  29. Wang, L.; Zhang, X.; Yang, H. Safety Helmet Wearing Detection Model Based on Improved YOLO-M. IEEE Access 2023, 11, 26247–26257. [Google Scholar] [CrossRef]
  30. Wu, H.; Zhao, J. An intelligent vision-based approach for helmet identification for work safety. Comput. Ind. 2018, 100, 267–277. [Google Scholar] [CrossRef]
  31. Hayat, A.; Morgado-Dias, F. Deep Learning-Based Automatic Safety Helmet Detection System for Construction Safety. Appl. Sci. 2022, 12, 8268. [Google Scholar] [CrossRef]
  32. Li, D.; Ye, Z.; Tang, J.; Wang, X. Visual measurement of valve opening area with improved subpixel edge location. Measurement 2022, 198, 111410. [Google Scholar] [CrossRef]
  33. Ahmed, M.F.; Hasan, M.K.; Chowdhury, M.Z.; Hoan, N.C.; Jang, Y.M. Continuous Status Monitoring of Industrial Valve Using OCC-Enabled Wireless Sensor Network. IEEE Trans. Instrum. Meas. 2022, 71, 5501010. [Google Scholar] [CrossRef]
  34. Xu, Z.; Li, T.; Deng, H. Research and application of cone valve seal detection algorithm based on yolov3. Proc. SPIE 2023, 12462, 650–656. [Google Scholar] [CrossRef]
  35. Qin, R.; Hua, Z.; Sun, Z.; He, R. Recognition method of knob gear in substation based on YOLOv4 and Darknet53-DUC-DSNT. Sensors 2022, 22, 4722. [Google Scholar] [CrossRef]
  36. Sun, Z.; Cui, Y.; Han, Y.; Jiang, K. Substation High-Voltage Switchgear Detection Based on Improved EfficientNet-YOLOv5s Model. IEEE Access 2024, 12, 60015–60027. [Google Scholar] [CrossRef]
  37. Wu, Z.; Tohti, G.; Geni, M.; He, H.; Turhun, F. Wind turbine rotor blade encoding marker recognition method based on improved YOLOv8 model. Signal Image Video Process. 2024, 1–12. [Google Scholar] [CrossRef]
  38. Hou, Q.; Zhou, D.; Feng, J. Coordinate attention for efficient mobile network design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 19–25 June 2021; pp. 13713–13722. [Google Scholar]
  39. Murrugarra-Llerena, J.; Kirsten, L.N.; Zeni, L.F.; Jung, C.R. Probabilistic Intersection-Over-Union for Training and Evaluation of Oriented Object Detectors. IEEE Trans. Image Process. 2024, 33, 671–681. [Google Scholar] [CrossRef] [PubMed]
  40. Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. Adv. Neural Inf. Process. Syst. 2020, 33, 21002–21012. [Google Scholar]
Figure 1. Framework of the real-time intelligent valve monitoring approach.
Figure 1. Framework of the real-time intelligent valve monitoring approach.
Sensors 24 05337 g001
Figure 2. Valves labeling process.
Figure 2. Valves labeling process.
Sensors 24 05337 g002
Figure 3. Network structure based on YOLOv8 for valve feature extraction.
Figure 3. Network structure based on YOLOv8 for valve feature extraction.
Sensors 24 05337 g003
Figure 4. Framework of feature extraction steps based on.
Figure 4. Framework of feature extraction steps based on.
Sensors 24 05337 g004
Figure 5. The structure of the CA module.
Figure 5. The structure of the CA module.
Sensors 24 05337 g005
Figure 6. The description of the rotating frame.
Figure 6. The description of the rotating frame.
Sensors 24 05337 g006
Figure 7. Calculation of height and width.
Figure 7. Calculation of height and width.
Sensors 24 05337 g007
Figure 8. Valve categories in the experiment.
Figure 8. Valve categories in the experiment.
Sensors 24 05337 g008
Figure 9. Valve designation schematic for Dataset 1.
Figure 9. Valve designation schematic for Dataset 1.
Sensors 24 05337 g009
Figure 10. Markers on handwheel valves.
Figure 10. Markers on handwheel valves.
Sensors 24 05337 g010
Figure 11. Valve designation schematic for Dataset 2.
Figure 11. Valve designation schematic for Dataset 2.
Sensors 24 05337 g011
Figure 12. Markers on an obstructed knob valve.
Figure 12. Markers on an obstructed knob valve.
Sensors 24 05337 g012
Figure 13. Training metrics of the proposed model.
Figure 13. Training metrics of the proposed model.
Sensors 24 05337 g013
Figure 14. Detection results under normal conditions.
Figure 14. Detection results under normal conditions.
Sensors 24 05337 g014
Figure 15. Detection results with valves obstructed.
Figure 15. Detection results with valves obstructed.
Sensors 24 05337 g015
Figure 16. Detection results under vary lighting conditions.
Figure 16. Detection results under vary lighting conditions.
Sensors 24 05337 g016
Figure 17. The mAP50 and val_loss of different model in the comparison experiment.
Figure 17. The mAP50 and val_loss of different model in the comparison experiment.
Sensors 24 05337 g017
Table 1. Datasets under normal conditions.
Table 1. Datasets under normal conditions.
Set No.Number of ValvesValve CategoryDataset Size
142277
261246
Table 2. Model performance under normal conditions.
Table 2. Model performance under normal conditions.
No.ClassMREAPP(FP)P(FN)
1Handwheel6.02%0.9954.06 × 10−32.03 × 10−3
2Lever11.01%0.9756.09 × 10−38.13 × 10−3
3Knob8.21%0.9816.83 × 10−37.75 × 10−3
Table 3. Model performance with valves obstructed.
Table 3. Model performance with valves obstructed.
ClassAPP(FP)P(FN)
knob10.9797.17 × 10−38.66 × 10−3
knob20.9825.46 × 10−34.10 × 10−3
Table 4. Model performance under vary lighting conditions.
Table 4. Model performance under vary lighting conditions.
ClassAPP(FP)P(FN)
knob10.9758.11 × 10−39.32 × 10−3
knob20.9805.66 × 10−34.22 × 10−3
Table 5. Ablation experimental results.
Table 5. Ablation experimental results.
MethodPrecisionRecallmAP50
YOLOv9e OBB model0.9250.9560.967
YOLOv8x OBB model0.9290.9760.944
YOLOv8n OBB model0.9660.9720.968
Proposed model0.9750.9890.979
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, Z.; Zhou, Q.; Jin, H.; Li, Q.; Dai, Y. A Real-Time Intelligent Valve Monitoring Approach through Cameras Based on Computer Vision Methods. Sensors 2024, 24, 5337. https://doi.org/10.3390/s24165337

AMA Style

Zhang Z, Zhou Q, Jin H, Li Q, Dai Y. A Real-Time Intelligent Valve Monitoring Approach through Cameras Based on Computer Vision Methods. Sensors. 2024; 24(16):5337. https://doi.org/10.3390/s24165337

Chicago/Turabian Style

Zhang, Zihui, Qiyuan Zhou, Heping Jin, Qian Li, and Yiyang Dai. 2024. "A Real-Time Intelligent Valve Monitoring Approach through Cameras Based on Computer Vision Methods" Sensors 24, no. 16: 5337. https://doi.org/10.3390/s24165337

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop