Image labeling method for oil and gas field station working condition recognition and storage medium
By using the equivalence function and energy functional method in the petrochemical field, the boundaries of the oil leakage target area are automatically determined and combined with the polygon annotation method to refine the labeling difficulty problem caused by low image contrast, and efficient and accurate data annotation is achieved.
Patent Information
- Application Number
- CN202411684911.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-22
AI Technical Summary
In the data set labeling of leak-off phenomenon in the petrochemical field, the existing technology has problems such as low image contrast and difficult to clearly distinguish between the target and the background, resulting in increased labeling difficulty and high labor costs.
The equal value set function is used to represent the oil leakage target area, and the energy functional and its gradient flow minimization process are designed to automatically determine the boundaries of the oil leakage target area, and refine them in combination with the polygon annotation method to improve the accuracy and efficiency of the labeling.
In complex environments such as insufficient light at night, the labeling accuracy and refinement of the boundaries of oil leakage areas is significantly improved, the workload and cost of manual labeling is reduced, and the quality of the data set and the generalization ability of the model are improved.
Smart Images

Figure CN119600387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil pipeline leakage detection, and in particular to an image annotation method and a storage medium for oil and gas station working condition recognition. Background Art
[0002] In view of the actual needs of intelligent inspection robots to detect and identify leakage in oil and gas stations, image recognition algorithms need to have high detection accuracy, strong real-time performance, and easy deployment. In order for the recognition model to meet the above requirements, it is key to build a high-quality data set suitable for AI model training.
[0003] In existing public datasets for detection, tracking, and recognition tasks, common annotation methods include box annotation and contour annotation, both of which are intended to clearly indicate the target object and its area or boundary. However, specific datasets for leakage in the petrochemical industry need to cover a variety of environmental conditions, such as scene conditions under daylight and night lights. It should be pointed out that insufficient light in night environments can lead to reduced image contrast, making it difficult to clearly distinguish between the target and the background, increasing the difficulty of data annotation. Among the existing annotation methods, although the use of contour line annotation can more accurately define the specific scope of leakage conditions, its annotation data requires a lot of labor and time costs. Therefore, it is particularly important to explore more efficient data annotation methods. Summary of the invention
[0004] The present invention provides an image annotation method and storage medium for oil and gas station working condition identification with higher efficiency and accuracy, which can solve at least one of the above-mentioned technical problems.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solution: an image annotation method for oil and gas station working condition identification, comprising the following steps:
[0006] S1, representing the oil spill target area in the two-dimensional image as a three-dimensional equivalued set function;
[0007] S2, design a binary step function to initialize the equal value set function and roughly locate the potential target area;
[0008] S3. Design an energy functional with desired variability and define the energy functional as the line integral along the zero contour of the contour set function;
[0009] S4, evolving the equivalent set function, solving the gradient flow minimization energy functional, and obtaining the zero equivalent set contour, that is, the boundary of the optimal oil spill target area, as the mask boundary;
[0010] S5. Verify whether the obtained mask boundary meets the requirements. If so, the evolved zero-equal-value set contour is used as the annotation result of the boundary of the oil spill target area in the image. If not, the polygon annotation method is used to refine the mask boundary to obtain the final annotation result.
[0011] Furthermore, in S1, the two-dimensional RGB image of the oil pipeline with leakage phenomenon collected by the camera is processed and converted into a grayscale image, and the oil leakage target area In(X) on the grayscale image is represented as a three-dimensional equivalued set function Φ(X, t), and the parameters of the equivalued set function include the spatial variable X and the time variable t.
[0012] Furthermore, in S2, according to the characteristic that the target area of the oil spill has a low intensity value, a binary step function is designed, and the equivalent set function is initialized according to the following formula:
[0013]
[0014] Where b0 is a constant and th is the intensity threshold of the potential target area.
[0015] Furthermore, in S3, an energy functional is designed for the expected difference of a specific area around the oil pipeline oil leak target, the expected difference term is used as the external energy, and the energy functional is defined as the line integral along the zero isovalue contour of the isovalue set function, further comprising:
[0016] S31. Define the expected difference energy functional e(Ф):
[0017]
[0018] Where G(.) represents the approximate Heaviside function, ξ represents a very small constant, b1(Ф) and b2(Ф) represent and the expected value of the intensity of its neighborhood Ω2, where the neighborhood Ω2 is defined as the area that is less than or equal to n pixels away from the zero contour L;
[0019] S32. Define the expected difference term as the line integral of the energy functional e(Φ) along the zero contour L of the equivalued set function Φ:
[0020]
[0021] Where δ(Ф) represents the approximate Dirac delta function, represents the gradient operator;
[0022] When L is located at the boundary of the oil spill target area, E e (Ф) minimum;
[0023] S33. The total energy functional is defined as:
[0024]
[0025] Among them, R(Ф) is the distance regularization term, A(Ф) is the area energy functional, sign(.) is the sign function, and α, β and μ are all expressed as weight coefficients;
[0026] When b1(Ф) is greater than the current maximum value b 1max (Ф) takes a positive value, the zero-valued set contour L shrinks, on the contrary, when b1(Ф) is less than the current maximum value b 1max (Ф) takes a negative value, and the zero-equal-value set contour L expands.
[0027] Furthermore, in S4, the gradient flow is solved according to the following formula to minimize the energy functional E(Φ) and obtain the final zero equal value set contour L as the submerged boundary of the target area:
[0028]
[0029] Among them, div(.) represents the divergence operator and dp(.) represents the correlation function of the double potential well.
[0030] Furthermore, in S5, the judgment criteria for whether the flooding boundary meets the requirements are:
[0031] If the difference between the mask boundary and the true boundary of the target area is less than the set threshold, the requirement is met and the mask boundary is used as the annotation result. Otherwise, if the difference between the mask boundary and the true boundary of the target area is greater than or equal to the set threshold, the requirement is not met and the polygon annotation method is used to fine-tune and refine the mask boundary to obtain the annotation result.
[0032] Furthermore, in S5, the polygon marking method comprises the following steps:
[0033] Determine polygon vertices: When the difference between the mask boundary and the real boundary of the target area is greater than or equal to the set threshold, first revise all polygon vertices determined by the automatic annotation method to ensure that all polygon vertices in the area are correctly marked;
[0034] Draw a polygon mask: connect all polygon vertices to generate a new polygon mask.
[0035] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the image annotation method for oil and gas station working condition identification.
[0036] The beneficial effects of the present invention are embodied in:
[0037] 1. The present invention uses an equivalued set function to represent the target area of the oil leak, and designs an energy functional and its gradient flow minimization process, which can more accurately define the specific scope of the leakage condition, especially in complex environments with insufficient lighting and low image contrast at night. Compared with traditional box annotation or simple contour annotation, this method can capture the boundaries of the oil leak area more carefully, improving the accuracy and detail of the annotation.
[0038] 2. The labeling method based on equivalent sets proposed in the present invention can automatically generate relatively complete contour labeling by assisting the labeling process through automated means. Compared with the traditional data labeling method that requires a lot of manual participation, is time-consuming and costly, this method can significantly reduce the workload of manual labeling, and reduce labor costs and time consumption.
[0039] 3. The method of the present invention can adapt to image annotation under different lighting conditions, making the constructed data set more comprehensive and representative, which is helpful to improve the generalization ability and robustness of the leakage condition identification model in the petrochemical field. It has the advantages of high efficiency, strong stability and high precision in solving data annotation and constructing training data sets, and can effectively solve the problem of pipeline oil leakage sample annotation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0041] Figure 1 It is a flow chart of an image annotation method for oil and gas station working condition identification according to an embodiment of the present invention.
[0042] Figure 2 It is a framework diagram of an image annotation method for oil and gas station working condition identification according to an embodiment of the present invention.
[0043] Figure 3 It is a framework diagram of an image polygon annotation method for oil and gas station working condition identification according to an embodiment of the present invention.
[0044] Figure 4 It is a structural block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. In the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0046] See also Figure 1-Figure 2 The embodiment of the present invention provides an image annotation method for oil and gas station working condition identification, including the following steps S1-S5:
[0047] S1. Represent the oil spill target area in the two-dimensional image as a three-dimensional equivalued set function.
[0048] Specifically, in this step, the two-dimensional RGB image of the oil pipeline with leakage collected by the camera is processed and converted into a grayscale image to construct a high-quality data set suitable for model training for detecting and identifying leakage conditions, and the oil leakage target area In(X) on the grayscale image is represented as a three-dimensional equivalued set function Φ(X, t), the parameters of which include the spatial variable X and the time variable t. Subsequently, by evolving the equivalued set function Φ, the zero equivalued set contour L can be obtained as the mask edge of the oil leakage target.
[0049] S2. Design a binary step function to initialize the equal value set function and roughly locate the potential target area.
[0050] Specifically, in this step, according to the characteristic that the target area of the oil spill has a low intensity value, a binary step function is designed, and the equivalent set function is initialized according to the following formula:
[0051]
[0052] Among them, b0 is a constant, which is taken as 1 here, and th is the intensity threshold of the potential target area, which is taken as 40 here.
[0053] S3. Design an energy functional with desired variability and define the energy functional as the line integral along the zero isovalue contour of the isovalue set function.
[0054] Specifically, in this step, an energy functional is designed for the expected difference of a specific area around the oil pipeline leak target, the expected difference term is used as the external energy, and the energy functional is defined as the line integral along the zero isovalue contour of the isovalue set function, further including:
[0055] S31. Define the expected difference energy functional e(Ф):
[0056]
[0057] Where G(.) represents the approximate Heaviside function, ξ represents a very small constant, b1(Ф) and b2(Ф) represent and the expected value of the intensity of its neighborhood Ω2, where the neighborhood Ω2 is defined as the area that is less than or equal to n pixels away from the zero contour L;
[0058] When calculating the target level detection index, the error within 5 pixels is still identified as the target area. The present invention takes n=5 to alleviate the background interference at a long distance.
[0059] S32. Define the expected difference term as the line integral of the energy functional e(Φ) along the zero contour L of the equivalued set function Φ:
[0060]
[0061] Where δ(Ф) represents the approximate Dirac delta function, represents the gradient operator;
[0062] When L is located at the boundary of the oil spill target area, E e (Ф) minimum;
[0063] S33. The total energy functional is defined as:
[0064]
[0065] Among them, R(Ф) is the distance regularization term, A(Ф) is the area energy functional, sign(.) is the sign function, and α, β and μ are all expressed as weight coefficients;
[0066] When b1(Ф) is greater than the current maximum value b 1max (Ф) takes a positive value, the zero-valued set contour L shrinks, on the contrary, when b1(Ф) is less than the current maximum value b 1max (Ф) takes a negative value, and the zero-equal-value set contour L expands.
[0067] S4, evolving the equivalent set function, solving the gradient flow minimization energy functional, and obtaining the zero equivalent set contour, that is, the boundary of the optimal oil spill target area, as the mask boundary.
[0068] Specifically, in this step, the gradient flow is solved according to the following formula to minimize the energy functional E(Φ) and obtain the final zero equal value set contour L as the submerged boundary of the target area:
[0069]
[0070] Among them, div(.) represents the divergence operator and dp(.) represents the correlation function of the double potential well.
[0071] S5. Verify whether the obtained mask boundary meets the requirements. If so, the evolved zero-equal-value set contour is used as the annotation result of the boundary of the oil spill target area in the image. If not, the polygon annotation method is used to refine the mask boundary to obtain the final annotation result.
[0072] Specifically, in this step, the criteria for judging whether the submerged boundary meets the requirements are:
[0073] If the difference between the mask boundary and the true boundary of the target area is less than the set threshold, the requirement is met and the mask boundary is used as the annotation result. Otherwise, if the difference between the mask boundary and the true boundary of the target area is greater than or equal to the set threshold, the requirement is not met and the polygon annotation method is used to fine-tune and refine the mask boundary to obtain the annotation result.
[0074] Furthermore, the polygon annotation method comprises the following steps:
[0075] Determine polygon vertices: When the difference between the mask boundary and the real boundary of the target area is greater than or equal to the set threshold, first revise all polygon vertices determined by the automatic annotation method to ensure that all polygon vertices in the area are correctly marked;
[0076] Draw a polygon mask: connect all polygon vertices to generate a new polygon mask.
[0077] like Figure 3 As shown in the figure, in an actual case application, the leakage phenomenon in the image was annotated using the automatic annotation method, but there was still an incomplete annotation. The automatic annotation method failed to mark some parts that were greatly disturbed by the background. Therefore, on this basis, the polygon annotation method was used for correction. First, all the vertices in the annotation area were corrected, and then all the vertices were connected and a new annotation mask was generated. This can achieve almost complete annotation of the leakage phenomenon in the image, further enhancing the efficiency and accuracy of image annotation.
[0078] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned image annotation method for oil and gas station working condition identification.
[0079] See also Figure 4 An embodiment of the present invention further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned image annotation method for oil and gas station working condition identification.
[0080] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the above-mentioned image annotation method for oil and gas station working condition identification.
[0081] It is understandable that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above methods.
[0082] It should be noted that those skilled in the art can understand that all or part of the steps implemented in the embodiments of the present invention can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using hardware, it can be implemented in whole or in part in the form of purchasing standard parts or modified parts. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0083] In summary, the present invention aims at solving the problems that the data set of oil pipeline leakage conditions has a complex background and different lighting conditions, which makes it difficult to clearly distinguish the target and the background, and the traditional annotation method requires a lot of labor cost and time cost. An efficient image annotation method for oil and gas station working condition identification is proposed in the present invention, which adopts a combination of automatic annotation and manual annotation. Specifically, the area of the pipeline leaking in the image is represented as an equivalued set function, and according to the characteristic that the target area of the oil leakage has a low intensity value, a set binary step function is used for initialization to roughly locate the potential target area, and then an energy functional with the expected difference is designed, and the boundary of the optimal oil leakage target area is searched by minimizing the energy functional to obtain a mask, and finally the mask is fine-tuned by using a polygonal annotation method to obtain the final annotation result, thereby realizing efficient annotation of the oil pipeline leakage image sequence, while ensuring the annotation quality, significantly reducing the labor cost and time consumption, and improving the annotation efficiency of oil pipeline leakage samples.
[0084] It should be understood that the examples and implementation modes described herein are for illustrative purposes only and are not intended to limit the present invention. Those skilled in the art may make various modifications or changes based on the examples and implementation modes. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An image annotation method for oil and gas station working condition identification, characterized in that: The following steps are involved: S1, representing the oil spill target area in the two-dimensional image as a three-dimensional equivalued set function; S2, design a binary step function to initialize the equal value set function and roughly locate the potential target area; S3. Design an energy functional with desired variability and define the energy functional as the line integral along the zero contour of the contour set function; S4, evolving the equivalent set function, solving the gradient flow minimization energy functional, and obtaining the zero equivalent set contour, that is, the boundary of the optimal oil spill target area, as the mask boundary; S5. Verify whether the obtained mask boundary meets the requirements. If so, the evolved zero-equal-value set contour is used as the annotation result of the boundary of the oil spill target area in the image. If not, the polygon annotation method is used to refine the mask boundary to obtain the final annotation result.
2. The image annotation method for oil and gas station working condition identification according to claim 1 is characterized in that: In S1, the two-dimensional RGB image of the oil pipeline with leakage phenomenon collected by the camera is processed and converted into a grayscale image, and the oil leakage target area In(X) on the grayscale image is represented as a three-dimensional equivalued set function Φ(X, t), and the parameters of the equivalued set function include the spatial variable X and the time variable t.
3. The image annotation method for oil and gas station working condition identification according to claim 1 is characterized in that: In S2, according to the characteristic that the target area of the oil spill has a low intensity value, a binary step function is designed, and the equivalent set function is initialized according to the following formula: Where b0 is a constant and th is the intensity threshold of the potential target area.
4. The image annotation method for oil and gas station working condition identification according to claim 3 is characterized in that: In said S3, an energy functional is designed for the expected difference of a specific area around the oil pipeline oil leak target, the expected difference term is used as the external energy, and the energy functional is defined as the line integral along the zero isovalue contour of the isovalue set function, further comprising: S31. Define the expected difference energy functional e(Ф): Where G(.) represents the approximate Heaviside function, ξ represents a very small constant, b1(Ф) and b2(Ф) represent and the expected value of the intensity of its neighborhood Ω2, where the neighborhood Ω2 is defined as the area that is less than or equal to n pixels away from the zero contour L; S32. Define the expected difference term as the line integral of the energy functional e(Φ) along the zero contour L of the equivalued set function Φ: Where δ(Ф) represents the approximate Dirac delta function, represents the gradient operator; When L is located at the boundary of the oil spill target area, E e (Ф) minimum; S33. The total energy functional is defined as: Among them, R(Ф) is the distance regularization term, A(Ф) is the area energy functional, sign(.) is the sign function, and α, β and μ are all expressed as weight coefficients; When b1(Ф) is greater than the current maximum value b 1max (Ф) takes a positive value, the zero-valued set contour L shrinks, on the contrary, when b1(Ф) is less than the current maximum value b 1max (Ф) takes a negative value, and the zero-equal-value set contour L expands.
5. The image annotation method for oil and gas station working condition identification according to claim 4 is characterized in that: In S4, the gradient flow is solved according to the following formula to minimize the energy functional E(Φ), and the final zero equal value set contour L is obtained as the submerged boundary of the target area: Among them, div(.) represents the divergence operator and dp(.) represents the correlation function of the double potential well.
6. The image annotation method for oil and gas station working condition identification according to claim 1 is characterized in that: In S5, the criteria for judging whether the flooding boundary meets the requirements are: If the difference between the mask boundary and the true boundary of the target area is less than the set threshold, the requirement is met and the mask boundary is used as the annotation result. Otherwise, if the difference between the mask boundary and the true boundary of the target area is greater than or equal to the set threshold, the requirement is not met and the polygon annotation method is used to fine-tune and refine the mask boundary to obtain the annotation result.
7. The image annotation method for oil and gas station working condition identification according to claim 1 is characterized in that: In S5, the polygon marking method comprises the following steps: Determine polygon vertices: When the difference between the mask boundary and the real boundary of the target area is greater than or equal to the set threshold, first revise all polygon vertices determined by the automatic annotation method to ensure that all polygon vertices in the area are correctly marked; Draw a polygon mask: connect all polygon vertices to generate a new polygon mask.
8. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of the image annotation method for oil and gas station working condition identification as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for performing bone multi-segmentation in imaging data
CA2940393A1
SAR (storage address register) image changing detection method based on improved C-V model
CN102779346A
Level set image segmentation method and system thereof based on regional information and edge information
CN106056611A
Ultrasonic image focus segmentation method and device and computer equipment
CN113034508A
Cited By
Image processing system and method for petroleum pipeline leakage detection
CN120747055A
An image processing system and method for use in petroleum pipeline leak detection
CN120747055B