Visual modeling method of ship pipe network program based on YOLOv8 target detection technology
Through YOLOv8 object detection technology and Python data processing, combined with C# programming, the automatic identification and integration of ship pipeline elements is solved, and the problem of inefficiency of traditional modeling methods is achieved, and efficient and convenient pipeline network system design and simulation are achieved.
Patent Information
- Application Number
- CN202510257030.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-07-18
AI Technical Summary
The existing modeling method of ship pipeline system is cumbersome, has a lot of workload and is inefficient. Traditional programming methods require a large amount of manual input and are prone to errors.
The YOLOv8 object detection technology is used to combine Python data processing and C# programming, and through WPF interface generation technology, the pipeline elements are automatically identified and integrated, and standardized CSV files are generated and real-time calculations are performed.
It realizes integrated operation of the marine pipeline system from design to simulation, improves design efficiency, reduces cumbersome manual input and artificial errors, and improves data processing capabilities and visualization characteristics.
Smart Images

Figure CN120337698A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of marine engineering, and more particularly, to a visualization modeling method for a ship pipeline network program based on the YOLOv8 object detection technology. Background Art
[0002] With the development of modeling and simulation technologies, constructing a simulation environment highly consistent with the real ship operation environment through digital twin technology for drill training, simulation operation, trend prediction, and risk management has become an important means in modern maritime engineering. The ship pipeline network system is a core component of the virtual scene. To restore the operation status of the actual ship, the virtual scene needs to be able to realistically simulate the dynamic characteristics of ship equipment, the fluid flow process, and the complex interactions between systems.
[0003] As the complexity of ship systems continues to increase, using traditional simulation programming methods to establish a simulation model of the system requires a large amount of time. Programmers usually need to process a large amount of data to handle complex parameters and models. This poses a huge challenge for those who are not proficient in programming or have no professional programming experience. Traditionally, solving these problems often relies on high-level programming languages and environments such as Matlab and Visual C++. To improve the programming efficiency of ship pipeline network programs, programmers have made great efforts. Shi et al. modeled a marine diesel generator system using an RBF neural network in 2005, and accurately predicted the dynamic response of the generator by inputting parameters such as the torque and excitation current of the diesel engine, providing a new idea for modeling complex systems. Kim I et al. developed a three-dimensional visualization tool for ship pipeline systems based on X3D technology in 2010, which supports cross-platform display and improves the efficiency of fault detection and design optimization. Zou et al. proposed a sparse matrix algorithm in 2015, successfully constructed a dynamic simulation model of the fuel supply system, and achieved a balance between system accuracy and real-time performance.
[0004] However, the programming process of the ship pipeline network system is very complex. Traditional programming methods usually require classifying complex pipelines layer by layer and then writing text code. The whole process is not only cumbersome, with a large workload and low efficiency, but also prone to omitting or double-counting pipeline branches. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to propose a visualization modeling method for a ship pipeline network program based on the YOLOv8 object detection technology to solve the technical problems of the existing ship pipeline network system modeling method being cumbersome, with a large workload, and low efficiency.
[0006] The technical means adopted by the present invention are as follows:
[0007] A visualization modeling method for a ship pipe network program based on the YOLOv8 object detection technology, comprising the following steps:
[0008] S1. Using the WPF interface generation technology, construct a human-computer interaction visualization interface for the ship pipe network system in the form of an SVG base map plus a control position map;
[0009] S2. Using the YOLOv8 object detection technology, identify the pipe network elements in the human-computer interaction visualization interface and obtain the identification results;
[0010] S3. Use the optimization algorithm of Python to classify and reorganize the identification results and recombine the model. The system generates an architecture model containing the spatial positions and attribute parameters of the pipe network elements and controls, and saves the architecture model in the form of a standardized CSV file;
[0011] S4. Use the C# programming language to convert the architecture model saved in the CSV file into a mathematical model and perform real-time calculations, and output the calculation results to the human-computer interaction visualization interface.
[0012] Further, S1 specifically includes the following steps:
[0013] Use drawing software to draw the base map of the pipe network system according to the design requirements of the ship pipe network. Use line segments and curves with arrows to represent the pipes and their flow directions, and save the base map in SVG format;
[0014] Import the SVG base map into the WPF framework, and drag controls from the control library to the corresponding positions to construct a human-computer interaction visualization interface for the ship pipe network system.
[0015] Further, S2 specifically includes the following steps:
[0016] Convert the SVG map and the WPF control position map into PNG format;
[0017] Use the YOLOv8 technology to identify the target elements. The target elements in the SVG map include water tanks, nodes, pipes, and arrows pointing up, down, left, and right; label the target elements in the SVG map; the target elements in the WPF control position map include valves and pumping stations pointing up, down, left, and right, and label the target elements in the WPF control position map;
[0018] Train the recognition model by setting the parameters of the target images in the ship pipe network system. The parameters include the upper left, lower left, upper right, lower right, and center point coordinates of the target elements.
[0019] Further, S3 specifically includes the following steps:
[0020] Number the target elements in the file according to the following rules: According to the coordinates of the center point of the element, first number them in ascending order of the X-axis coordinates. If the X-axis coordinates are the same, then number them in ascending order of the Y-axis coordinates; for the control elements in WPF, only the center point coordinates need to be considered when numbering; for the pipe segments in the SVG diagram, consider the coordinates of the upper left corner, lower left corner, upper right corner, lower right corner, center point, and the midpoint coordinates of the two shortest sides when numbering; name the midpoint coordinates of the two shortest sides as nearest_midpoint and second_nearest_midpoint, and save them in the last two columns of the file, where the nearest_midpoint column is the point with the smaller X-axis. If the X-axis is equal, take the point with the smaller Y-axis; integrate the target elements into a network file in CSV format according to the numbers;
[0021] The first column of the network file is named PipeID, and its content is the pipe segment name. The second column is named Name, and its content is the control name on the pipe segment; the third column of the file is named PipeDirection, and its content is the flow direction of the pipe segment. It is judged according to the flow direction identifier recognized and marked by YOLOV8. If it is Right Arrow or Down Arrow, enter AB in the corresponding cell. If it is Left Arrow or Up Arrow, enter BA. If there is no arrow, enter CC to indicate that the fluid can flow in both directions; the fourth and fifth columns of the network file are named PipeConnecterA and PipeConnecterB respectively, and record the coordinates overlapping with the nearest_midpoint and second_nearest_midpoint columns in the SVG result file; the sixth and seventh columns of the network program are named IsSource and IsTerminal respectively, and record whether the pipe segment is the source pipe segment and the terminal pipe segment;
[0022] Output two standardized CSV files and automatically import them into the C# programming language.
[0023] Furthermore, S4 specifically includes the following steps:
[0024] Use a mathematical model to describe the flow state of the pipeline model. By traversing, read and evaluate the control states on the pipe segment; the condition for the pipeline to be able to flow is: when the number of opened controls on the pipeline is the same as the number of controls saved in the CSV file, it is determined that the pipeline is in a flowing state; when all the pipelines from the source pipeline to the terminal pipeline are in a flowing state, start the calculation of the flow rate and pressure of the entire pipeline;
[0025] The flow calculation method is as follows: the program requests flow from the pump inlet to the source section based on the pump power and the pipeline flow direction in the CSV; if the maximum flow of the upstream pipe section exceeds the rated flow of the pump, the system requests it from the section according to the rated flow of the pump; if the maximum flow of the upstream pipe section does not reach the rated flow of the pump, the system adjusts the requested value according to the maximum flow limit of the section; the flow is temporarily stored in the upstream node of each level of pump and continuously requested from the upstream node until the source; when there are multiple branches in the upstream node, the system implements an equal flow distribution strategy, that is, the flow is requested from each branch node on average; if the maximum flow limit of any branch is lower than the average value, the system requests it according to the maximum flow of the branch, and the remaining flow is distributed to other branches at the same level; when all branches at the same level reach their maximum flow limits, the system automatically adjusts the maximum flow of the upstream node to the sum of the maximum flow limits of all branches at the same level; after the flow is assigned to the source, it will be distributed to each branch node downstream along the pipeline; the pump outlet is processed as follows: the flow temporarily stored in the pump node is distributed downward according to the maximum allowable value of the downstream section, and adjusted according to the average distribution principle and the maximum flow limit until it reaches the terminal.
[0026] The present invention also provides a storage medium, which includes a stored program, wherein when the program is run, a visualization modeling method based on YOLOv8 target detection technology of any of the above-mentioned ship pipe network programs is executed.
[0027] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes a visualization modeling method based on YOLOv8 target detection technology of any of the above-mentioned ship pipe network programs through the computer program.
[0028] Compared with the prior art, the present invention has the following advantages:
[0029] The present invention is mainly suitable for the model building, design and optimization of complex pipe network systems of actual ships, as well as the design and implementation of digital twin programs. It utilizes the YOLOv8 intelligent detection and recognition method, combines Python data processing, C# programming and WPF interface generation technology, significantly improves the data processing capability, and effectively avoids the errors and inefficiencies caused by traditional manual input, with high efficiency and good visualization characteristics.
[0030] The present invention combines a number of advanced technologies, including YOLOv8 target detection technology, Python data processing and WPF interface generation technology, to automatically identify and integrate complex pipe network topology and control information into an operable data format, and finally complete efficient calculation and result output by C#. The entire process realizes the integrated operation of the ship pipe network system from design to simulation, which significantly improves the design efficiency and makes the operation more convenient. Compared with the traditional pipe network design method, the present invention reduces cumbersome manual input and repetitive operations, and reduces the possibility of human error. At the same time, the intuitive graphical interface not only improves the human-computer interaction experience, but also provides designers with a clearer overall picture of the system, which helps to quickly adjust and optimize the design scheme. This automated modeling method makes the design and simulation of the pipe network system more efficient and accurate. In addition, the method of using YOLOv8 target detection technology to input pipe network information in the present invention has good modularity and extensibility, can flexibly adapt to different types of pipe network system requirements, and provides technical support for the modeling and optimization of complex systems in the future. At the same time, its wide applicability makes it have important promotion value in teaching, scientific research and practical engineering applications in the field of ship engine engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 The figure is a flow chart of the method of the present invention.
[0033] Figure 2 It is a processing flow chart of the pipeline node of the present invention.
[0034] Figure 3 It is the human-computer interaction graphical interface of the present invention.
[0035] Figure 4 This is the SVG image recognition result diagram of the present invention.
[0036] Figure 5 This is the WPF control position map recognition result map of the present invention.
[0037] Figure 6 It is a confidence-precision curve diagram of the training result of the present invention; wherein a is the confidence-precision curve for identifying pipelines, nodes, and water tanks; b is the confidence-precision curve for identifying valves and pump stations.
[0038] Figure 7 This is a partial example diagram of a CSV file generated after conversion by the present invention.
[0039] Figure 8 This is the base map of the sewage system interface of the present invention.
[0040] Figure 9 This is the position map of the WPF controls of the present invention.
[0041] Figure 10 This is the interface display map during the operation of the program of the present invention. Detailed implementation manners
[0042] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0043] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0044] As Figure 1 shown, the present invention provides a visualization modeling method for a ship pipe network program based on the YOLOv8 object detection technology, including the following steps:
[0045] S1. Using the WPF interface generation technology, construct a human-computer interaction visualization interface for the ship pipe network system in the form of an SVG base map plus a control position map;
[0046] S2. Using the YOLOv8 object detection technology, identify the pipe network elements in the human-computer interaction visualization interface and obtain the identification results;
[0047] S3. Using the optimization algorithm of Python, classify and organize the identification results and reorganize the model. The system generates an architecture model including the spatial positions and attribute parameters of the pipe network elements and controls, and saves the architecture model in the form of a standardized CSV file;
[0048] S4. Use the C# programming language to convert the architecture model saved in the CSV file into a mathematical model for real-time calculation, and output the calculation results to the human-computer interaction visualization interface.
[0049] Through the comprehensive application of WPF interface generation technology, YOLOv8 object recognition, Python data processing, and C# high-efficiency calculation output, the present invention constructs a complete solution for the design, analysis, and optimization of the ship pipe network system. This solution can efficiently realize the visual modeling and optimization of the ship pipe network system, and greatly improve the design and development efficiency. The overall working process of the program is as follows:
[0050] First, the designer uses professional drawing software to draw the base map of the pipe network system according to the design requirements of the ship pipe network and saves the base map in SVG format. Subsequently, the designer imports the SVG base map into the WPF framework, and drags controls such as pumps, valves, pipes, and other pipe network devices from the control library to the corresponding positions to construct the human-computer interaction visualization interface of the ship pipe network system.
[0051] Next, the program uses YOLOv8 object detection technology to automatically identify the pipe network elements in the interface. This process includes extracting the pipe topology structure from the SVG diagram and identifying the positions of the controls in the WPF interface.
[0052] The recognition results are processed by Python optimization algorithms. The system classifies, organizes, and reorganizes the recognized elements, and outputs the final structure data in the standardized CSV file format.
[0053] Finally, the C# program automatically converts the data in the CSV file into a mathematical model and performs rapid calculations on it. The calculation results are presented in real time on the visualization interface.
[0054] In S1: Build a clear and intuitive graphical interface to accurately display the topological structure of the entire pipe network, which is not only necessary for subsequent YOLOv8 detection and recognition, but also an important link to improve the human-computer interaction experience and visualization characteristics of the program. The program uses the form of "base map + controls" to build the graphical interface. The base map is drawn by professional drawing software according to the engineering drawings, and uses arrowed line segments and curves to represent the pipes and their flow directions, and is saved in SVG format to ensure high resolution. After the base map is imported into the WPF framework, control elements such as valves, pumps, liquid level gauges, and their corresponding labels are added. The constructed WPF interface is as Figure 3 shown. The WPF framework is highly integrated with the C# programming language. Utilizing the high execution efficiency characteristics of the C# programming language, the interface can run efficiently when the program starts.
[0055] In S2: Target recognition is a key part of this program. The program uses YOLOv8 object detection technology to recognize the designed SVG diagram and the WPF control position diagram. YOLOv8 extracts features and locates targets from the input images through a convolutional neural network (CNN), and can quickly and accurately identify various devices and connection points, and store these parameters (including the position, shape, size, etc. of the devices) in the database.
[0056] To improve the recognition accuracy, first, the SVG diagram and the WPF control position diagram need to be converted into PNG format for easy recognition. Subsequently, YOLOv8 technology is used to recognize the target elements. The target elements in the SVG diagram include water tanks, nodes, pipes, and arrows pointing up, down, left, and right (indicating the flow direction in the pipes), which are labeled as Tank, Node, Pipe, UpArrow, Down Arrow, Left Arrow, and Right Arrow. The target elements in the WPF control position diagram include valves and pump stations pointing up, down, left, and right, which are labeled as Valve, Up Pump, Down Pump, LeftPump, and RightPump. When labeling, all elements are randomly combined and labeled using Labelme. Labelme supports labeling various forms of images, including polygons, rectangles, circles, and polylines, etc.
[0057] By setting the parameters of the target images in the ship pipe network system, the recognition model is trained. The training content is to recognize the position coordinates of the target images, and the target images are located through the set parameters (the upper left corner, lower left corner, upper right corner, lower right corner, and center point coordinates of the target elements). The training results are as Figure 4 and Figure 5 shown. The confidence - precision curve after training is as Figure 6 shown. The recognition model achieves an accuracy of 0.964 for the SVG diagram and an accuracy of 0.93 for the WPF control position diagram. The training results show that this program can effectively recognize and locate all elements in the ship pipe network system.
[0058] In S3: The Python optimization algorithm processes and converts the recognition results of YOLOv8 to ensure the integrity and accuracy of the data, and outputs a CSV network file that can be used for real-time calculation. The data conversion process is as follows: The program first numbers the target elements in the file. The numbering rule is: According to the coordinates of the center point of the element, first number them in ascending order of the X-axis coordinate. If the X-axis coordinates are the same, then number them in ascending order of the Y-axis coordinate. For the control elements in WPF, only the center point coordinates need to be considered when numbering; for the pipe segment part in the SVG diagram, when numbering, not only the coordinates of the upper left corner, lower left corner, upper right corner, lower right corner, and the center point need to be considered, but also the midpoint coordinates of the 2 shortest sides need to be considered, and they are named nearest_midpoint and second_nearest_midpoint, and saved in the last two columns of the file. Among them, the nearest_midpoint column is the point with the smaller X-axis. If the X-axis is equal, then take the point with the smaller Y-axis. Subsequently, the target elements are integrated into a CSV-format network file according to the numbers. Some file examples are shown as Figure 7 shown below.
[0059] The first column of the network file is named PipeID, and its content is the pipe segment name. The second column is named Name, and its content is the control name on the pipe segment. The third column of the file is named PipeDirection, and the content is the flow direction of the pipe segment. The program will judge according to the flow direction identifier recognized and marked by YOLOV8. If it is Right Arrow or Down Arrow, then enter AB in the corresponding cell. If it is Left Arrow or Up Arrow, then enter BA. If there is no arrow, then enter CC to indicate that the fluid can flow in both directions. The fourth and fifth columns of the network file are named PipeConnecterA and PipeConnecterB respectively, and record the coordinates that overlap with the nearest_midpoint and second_nearest_midpoint columns (the upper left corner coordinates and the lower right corner coordinates) in the SVG result file. For example, when the program determines that the nearest_midpoint of Pipe1 overlaps with the second_nearest_midpoint of Pipe2, it will fill in 2B in the PipeConnecterA column of Pipe1 and 1A in the PipeConnecterB column of Pipe2. If there are multiple pipe overlaps, they are separated by commas. The sixth and seventh columns of the network program are named IsSource and IsTerminal respectively, and record whether the pipe segment is the source pipe segment and the terminal pipe segment. Through the above steps, the program realizes the effective integration and conversion of the data, ensures the accuracy and integrity of the data, and lays a solid foundation for the subsequent data processing and calculation.
[0060] Through the processing and conversion of the Python optimization algorithm, the program will output two standardized CSV files and automatically import them into the C# program for calculation and output. Thanks to the efficient processing capabilities of the C# programming language and the seamless integration of C# and WPF frameworks, the calculation results can be output in real time and displayed on the human-computer interactive visualization interface.
[0061] In S4: With the powerful interface design capabilities and efficient data binding functions of WPF technology, the program can achieve complex graphical interfaces and smooth user experience. Users can interact by clicking on valves or pumps on the interface. When the user triggers a click event, the clicked control changes color to indicate the status. Next, the program will analyze the pipeline network to determine which pipelines can flow fluid. The program reads and evaluates the status of controls on the pipe section by traversing. The condition for the pipeline to flow is: when the number of controls turned on on the pipeline is consistent with the number of controls saved in the CSV file, the program determines that the pipeline is in a flow state. When all pipelines from the source pipeline to the terminal pipeline are in a flow state, the flow and pressure calculation process of the entire pipeline will start.
[0062] The flow calculation is detailed as follows: the program requests flow from the pump inlet to the source section based on the pump power and the pipeline flow direction in the CSV. If the maximum flow of the upstream pipe section exceeds the rated flow of the pump, the system requests it from the section according to the rated flow of the pump; if the maximum flow of the upstream pipe section does not reach the rated flow of the pump, the system adjusts the request value according to the maximum flow limit of the section. The flow is temporarily stored in the upstream node of each pump level and is continuously requested from the upstream node until the source. When there are multiple branches in the upstream node, the system implements an equal flow distribution strategy, that is, the flow is requested from each branch node on average. If the maximum flow limit of any branch is lower than the average value, the system requests it according to the maximum flow of the branch, and the remaining flow is distributed to other branches at the same level. When all branches at the same level reach their maximum flow limits, the system automatically adjusts the maximum flow of the upstream node to the sum of the maximum flow limits of all branches at the same level. After the flow is assigned to the source, it will be distributed to each branch node downstream along the pipeline. The pump outlet is processed similarly. The flow temporarily stored in the pump node is distributed downward according to the maximum allowable value of the downstream section, and adjusted according to the average distribution principle and the maximum flow limit until it reaches the terminal. The whole process ensures the accurate and balanced distribution of the flow from the source to the terminal pipe section.
[0063] The present invention provides an efficient and accurate solution, avoiding the cumbersome process of programmers manually sorting out the pipeline network topology, control element property parameters, and system interaction relationships. The program can automatically extract the positions, types, and connection relationships of pipeline network elements by combining YOLOv8 technology and Python data processing, and quickly generate model architecture files. At the same time, a system model established based on pipeline network damping, pipe diameter, and node characteristic parameters, combined with the efficient processing ability of the C# programming language, can accurately calculate parameters such as the flow rate and pressure of the pipeline. The present invention significantly reduces the workload of designers, optimizes the design process, and improves the design efficiency. In addition, the present invention can also be used for the generation of a ship digital twin system to achieve coordinated simulation between the ship pipeline network and other subsystems. By connecting the pipeline and pump characteristic parameters, the pipeline network is associated with other system chains for joint simulation. At the same time, the system can not only accurately simulate the dynamic changes during the operation of an actual ship, such as the fluctuation of pipeline pressure, the opening and closing states of valves, and the responses of the system under different working conditions, but also analyze data and judge trends based on changes in pipeline network damping, displacement, etc. caused by wear coefficients and fault coefficients, providing data support and decision-making basis for drill training, ship operation, and maintenance.
[0064] Embodiment
[0065] Taking the sewage system of a certain ship as an example for program design. First, designers accurately draw the base map using Inkscape software according to the engineering drawings of the sewage system. The content of the base map includes pipelines and their flow direction markings, the topology of the pipeline network, and other related equipment, such as Figure 8 as shown. The base map is finally saved in SVG format to ensure high resolution and data integrity.
[0066] Subsequently, designers import the base map into the WPF framework and further complete the interface construction according to the engineering drawings of the sewage system. During the interface design process, various controls (such as various types of valves, pump stations, and their corresponding labels) are dragged from the WPF control library to the corresponding positions on the base map. Through an intuitive layout, the graphical human-computer interaction interface of the sewage system is constructed.
[0067] Finally, designers generate a control element position map (such as Figure 9 as shown) by hiding the base map in the WPF interface, and save this map together with the SVG base Figure 1 map in PNG format. Thus, designers do not need to perform complex manual programming in the interface backend to write target elements and related information as in traditional methods. The program will automatically use YOLOv8 technology to quickly locate, filter, extract target elements in the base map and the control element position map, and automatically classify, sort, and integrate them. The recognition results are as shown in Figure 4 and Figure 5As shown below. Subsequently, the program uses Python algorithms to classify and reorganize the recognition results and reconstruct the model, and outputs a standardized CSV networking file, such as Figure 7 shown. The C# program will analyze and calculate the CSV networking file and output the calculation results on the WPF interface.
[0068] After the user enters the program, they will see an operable graphical interface as Figure 3 shown. The user can interact by clicking on controls such as valves and pumps. The clicked control will turn the color of the pipe it belongs to, indicating that the control is open. Taking the Clean Drain Tank module as an example, when the pump on the left and the three valves are all open, the program will determine that this pipeline is in a flowing state, and the C# program will automatically calculate the flow rate on this pipeline and display the calculation results on the label at the control, as Figure 10 shown.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A visualization modeling method for a ship pipe network program based on the YOLOv8 object detection technology, characterized in that, It includes the following steps: S1. Using the WPF interface generation technology, construct the human-computer interaction visualization interface of the ship pipeline network system in the form of an SVG base map plus a control position map; S2. Using the YOLOv8 object detection technology, identify the pipeline network elements in the human-computer interaction visualization interface and obtain the recognition results; S3. Use the optimization algorithm of Python to classify and reorganize the recognition results and reconstruct the model. The system generates an architecture model containing the spatial positions and attribute parameters of the pipeline network elements and controls, and saves the architecture model in the form of a standardized CSV file; S4. Use the C# programming language to convert the architecture model saved in the CSV file into a mathematical model and perform real-time calculations, and output the calculation results to the human-computer interaction visualization interface.
2. The visualization modeling method of the ship pipe network program based on the YOLOv8 object detection technology according to claim 1, characterized in that S1 specifically includes the following steps: Use drawing software to draw the base map of the pipeline network system according to the design requirements of the ship pipeline network. Use line segments and curves with arrows to represent the pipelines and their flow directions, and save the base map in SVG format; Import the SVG base map into the WPF framework, and drag and drop controls from the control library to the corresponding positions to construct the human-computer interaction visualization interface of the ship pipeline network system.
3. The visualization modeling method of the ship pipe network program based on the YOLOv8 object detection technology according to claim 1, characterized in that, S2 specifically includes the following steps: Convert the SVG map and the WPF control position map into PNG format; Use the YOLOv8 technology to identify the target elements. The target elements in the SVG map include water tanks, nodes, pipelines, and arrows pointing up, down, left, and right; label the target elements in the SVG map; the target elements in the WPF control position map include valves and pumping stations pointing up, down, left, and right, and label the target elements in the WPF control position map; Train the recognition model by setting the parameters of the target images in the ship pipeline network system. The parameters include the upper left corner, lower left corner, upper right corner, lower right corner, and center point coordinates of the target elements.
4. The visualization modeling method of the ship pipe network program based on the YOLOv8 object detection technology according to claim 1, characterized in that, S3 specifically includes the following steps: Number the target elements in the file. The numbering rules are as follows: According to the center point coordinates of the elements, first number them in ascending order of the X-axis coordinates. If the X-axis coordinates are the same, then number them in ascending order of the Y-axis coordinates; for the control elements in WPF, only consider the center point coordinates when numbering; for the pipe segment part in the SVG map, consider the upper left corner, lower left corner, upper right corner, lower right corner, center point coordinates, and the midpoint coordinates of the two shortest sides when numbering; name the midpoint coordinates of the two shortest sides as nearest_midpoint and second_nearest_midpoint, and save them in the last two columns of the file, where the nearest_midpoint column is the point with the smaller X-axis. If the X-axis is equal, take the point with the smaller Y-axis; integrate the target elements into a network file in CSV format according to the numbers. The first column of the networking file is named PipeID, and its content is the name of the pipe segment. The second column is named Name, and its content is the name of the control on the pipe segment. The third column of the file is named PipeDirection, and its content is the flow direction of the pipe segment. It is judged according to the flow direction identification identified and marked by YOLOV8. If it is RightArrow or Down Arrow, enter AB in the corresponding cell, if it is LeftArrow or Up Arrow, enter BA, if there is no arrow, enter CC to indicate that the fluid can flow to both ends; the fourth and fifth columns of the networking file are named PipeConnecterA and PipeConnecterB, respectively, recording the coordinates that overlap with the nearest_midpoint and second_nearest_midpoint columns in the SVG result file; the sixth and seventh columns of the networking program are named IsSource and IsTerminal, respectively, recording whether the pipe segment is the source pipe segment and the terminal pipe segment; Outputs two standardized CSV files and automatically imports them into the C# programming language.
5. The visualization modeling method of the ship pipe network program based on the YOLOv8 object detection technology according to claim 1, characterized in that, S4 specifically includes the following steps: A mathematical model is used to describe the flow state of the pipeline model. The control state on the pipe section is read and evaluated by traversal. The condition for the pipeline to flow is: when the number of controls turned on on the pipeline is consistent with the number of controls saved in the CSV file, the pipeline is judged to be in a flow state. When all pipelines from the source pipeline to the terminal pipeline are in a flow state, the flow and pressure calculation of the entire pipeline is started. The flow calculation method is as follows: the program requests flow from the pump inlet to the source section based on the pump power and the pipeline flow direction in the CSV; if the maximum flow of the upstream pipe section exceeds the rated flow of the pump, the system requests it from the section according to the rated flow of the pump; if the maximum flow of the upstream pipe section does not reach the rated flow of the pump, the system adjusts the requested value according to the maximum flow limit of the section; the flow is temporarily stored in the upstream node of each level of pump and continuously requested from the upstream node until the source; when there are multiple branches in the upstream node, the system implements an equal flow distribution strategy, that is, the flow is requested from each branch node on average; if the maximum flow limit of any branch is lower than the average value, the system requests it according to the maximum flow of the branch, and the remaining flow is distributed to other branches at the same level; when all branches at the same level reach their maximum flow limits, the system automatically adjusts the maximum flow of the upstream node to the sum of the maximum flow limits of all branches at the same level; after the flow is assigned to the source, it will be distributed to each branch node downstream along the pipeline; the pump outlet is processed as follows: the flow temporarily stored in the pump node is distributed downward according to the maximum allowable value of the downstream section, and adjusted according to the average distribution principle and the maximum flow limit until it reaches the terminal.
6. A storage medium, characterized in that, The storage medium includes a stored program, wherein when the program is run, the visual modeling method based on the YOLOv8 target detection technology of the ship pipe network program described in any one of claims 1 to 5 is executed.
7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor runs through the computer program to execute the visualization modeling method of the ship pipe network program based on the YOLOv8 object detection technology described in any one of claims 1 to 5.
Citation Information
Cited By
Multi-target detection and distance measurement integrated system based on YOLOv5
CN120928329A