Tunnel flow field distribution prediction method and related device
By obtaining and processing tunnel piercing images, determine the distribution of target objects, and enter the flow field distribution prediction model, solve the problem of difficulty to quickly predict the distribution of tunnel flow fields, and realize the rapid prediction and efficient calculation in dynamic changes. Essence
Patent Information
- Application Number
- CN202411484056.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-28
AI Technical Summary
Traditional methods are difficult to quickly predict tunnel flow field distribution under dynamically changing vehicle flow distribution and pollutant source scenarios, and the existing deep neural network models cannot adapt to different numbers of vehicles and pollutant sources.
By obtaining the target tunnel pultling image, determine the surface distance distribution and location distribution of the target object, and enter the trained stream field distribution prediction models to obtain wind speed distribution, pollutant concentration distribution and temperature field distribution.
In the scene of dynamic changes, the distribution of tunnel flow fields is quickly predicted. It is suitable for different numbers of vehicles and pollutants, and the calculation speed is faster than the traditional simulation method.
Smart Images

Figure CN119378384A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of flow field distribution prediction, and in particular to a tunnel flow field distribution prediction method and related devices. Background Art
[0002] The ventilation effect in tunnels is usually poor, making it difficult for pollutants produced by combustion and automobile exhaust to dissipate, posing a serious threat to the life and health of pedestrians. Therefore, accurate prediction of the flow field distribution in tunnels is crucial to the safe operation of tunnels.
[0003] In the traditional solution, multiple geometric models are established through 3D modeling software for the dynamically changing traffic distribution and pollutant sources in the tunnel, and then the multiple geometric models are simulated and calculated based on computational fluid dynamics (CFD) technology to obtain the tunnel flow field distribution. However, the modeling process and simulation calculation process are time-consuming and computationally intensive, and cannot achieve rapid prediction of tunnel flow field distribution in dynamically changing scenarios.
[0004] There is also a solution that combines CFD technology with a fully connected neural network. This solution uses the values of the grid nodes of the CAD (Computer-Aided Design) model modeled by CFD as the input of the deep neural network, so that the deep neural network outputs the tunnel flow field distribution. However, once the deep neural network is trained, the number of grid nodes input into the deep neural network will remain fixed, and the number of grid nodes is positively correlated with the number of vehicles in the tunnel and the number of pollutant sources. As a result, the trained deep neural network can only predict the flow field distribution of tunnels containing a fixed number of vehicles and pollutant sources, and cannot be applied to dynamically changing scenarios. Summary of the invention
[0005] In view of the above problems, the present application provides a tunnel flow field distribution prediction method and related devices to achieve the purpose of quickly predicting the tunnel flow field distribution when the traffic distribution and pollutant concentration distribution in the tunnel change dynamically. The specific scheme is as follows:
[0006] The first aspect of the present application provides a method for predicting tunnel flow field distribution, comprising:
[0007] Acquire a bird's-eye view image of a target tunnel, wherein the bird's-eye view image of the target tunnel includes a target object that affects the distribution of a tunnel flow field;
[0008] Based on the overhead image of the target tunnel, determining the surface distance distribution and position distribution of the target object;
[0009] The surface distance distribution and position distribution of the target object are input into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model, wherein the tunnel flow field distribution includes wind speed distribution, pollutant concentration distribution and temperature field distribution, and the flow field distribution prediction model is trained using the training tunnel aerial image that annotates the real tunnel flow field distribution as training data.
[0010] In a possible implementation, inputting the surface distance distribution and position distribution of the target object into a flow field distribution prediction model to obtain a tunnel flow field distribution output by the model includes:
[0011] The surface distance distribution and position distribution of the target object and the tunnel boundary distance distribution are input into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model, wherein the tunnel boundary distance distribution is obtained based on the overhead image of the target tunnel.
[0012] In a possible implementation, determining the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel includes:
[0013] Performing edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object;
[0014] Calculating the average value of the real distance from each point in the binary image to each of the target objects to obtain the surface distance distribution of the target objects;
[0015] Different labels are added to the target object and non-target objects in the binary image to obtain the position distribution of the target object.
[0016] In a possible implementation, the process of determining the tunnel boundary distance distribution includes:
[0017] Performing edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object;
[0018] The average value of the real distance from each point in the binary image to the tunnel boundary is calculated to obtain the tunnel boundary distance distribution.
[0019] In a possible implementation, the actual tunnel flow field distribution is obtained by establishing a geometric model of the tunnel in the training tunnel overhead image and performing simulation calculations.
[0020] In one possible implementation, the target objects include vehicles and pollutant sources;
[0021] The surface distance distribution of the target object includes the surface distance distribution of the vehicle, or the surface distance distribution of the target object includes the surface distance distribution of the vehicle and the surface distance distribution of the pollutant source.
[0022] A second aspect of the present application provides a tunnel flow field distribution prediction device, comprising:
[0023] An image acquisition module, used to acquire an overhead image of a target tunnel, wherein the overhead image of the target tunnel includes a target object that affects the distribution of the tunnel flow field;
[0024] An input determination module is used to determine the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel;
[0025] A model prediction module is used to input the surface distance distribution and position distribution of the target object into a flow field distribution prediction model to obtain a tunnel flow field distribution output by the model, wherein the tunnel flow field distribution includes wind speed distribution, pollutant concentration distribution and temperature field distribution, and the flow field distribution prediction model is trained using a training tunnel aerial image that annotates the real tunnel flow field distribution as training data.
[0026] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the tunnel flow field distribution prediction method of the above-mentioned first aspect or any implementation of the first aspect.
[0027] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0028] The memory is used to store computer programs;
[0029] The processor is used to execute the computer program so that the electronic device can implement the tunnel flow field distribution prediction method of the above-mentioned first aspect or any implementation method of the first aspect.
[0030] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the tunnel flow field distribution prediction method of the above-mentioned first aspect or any implementation of the first aspect.
[0031] By means of the above technical solution, the tunnel flow field distribution prediction method provided by the present application obtains the overhead image of the target tunnel, determines the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel, inputs the surface distance distribution and position distribution of the target object into the flow field distribution prediction model, and obtains the tunnel flow field distribution output by the model. It can be seen that no matter how many target objects are contained in the overhead image of the target tunnel, the present application can obtain the input of the flow field distribution prediction model based on the overhead image of the target tunnel, so the flow field distribution prediction model of the present application can be applied to all dynamically changing scenes. Compared with the process of modeling and simulation calculation, the calculation speed of the flow field distribution prediction model is faster, thereby realizing the rapid prediction of the tunnel flow field distribution in the dynamically changing scene based on the flow field distribution prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0033] Figure 1 A schematic diagram of a system architecture provided for this application;
[0034] Figure 2 A schematic diagram of an optional hardware structure of a terminal 100 provided in this application;
[0035] Figure 3 A schematic diagram of the structure of a server 200 provided in this application;
[0036] Figure 4 A schematic diagram of a flow chart of a tunnel flow field distribution prediction method provided in this application;
[0037] Figure 5 A schematic diagram of the structure of a tunnel flow field distribution prediction device provided in this application;
[0038] Figure 6 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0039] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0040] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0041] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0042] See also Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.
[0043] Among them, an application corresponding to the third-party system can be installed on the terminal 100. The above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the interface and send the above parameters to the server 200. The server 200 can obtain processing results based on the received parameters and return the processing results to the terminal 100.
[0044] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.
[0045] Next describe Figure 1 The product form of the mid-terminal 100;
[0046] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.
[0047] Figure 2An optional hardware structure diagram of the terminal 100 is shown.
[0048] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0049] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0050] Among them, the input device 132 can receive input data and the like.
[0051] The display unit 140 may be used to display information input by a user or provided to a user, various menus of the terminal 100, an interactive interface, file display, and / or playback of any multimedia file.
[0052] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0053] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0054] Among them, the memory 120 can be used to store software codes related to the tunnel flow field distribution prediction method, the processor 170 can execute the steps of the tunnel flow field distribution prediction method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve corresponding functions.
[0055] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0056] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.
[0057] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0058] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0059] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0060] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0061] Next describe Figure 1 The product form of the server 200;
[0062] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0063] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0064] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0065] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0066] The memory 204 may be used to store software codes related to the tunnel flow field distribution prediction method, and the processor 202 may execute the steps of the tunnel flow field distribution prediction method of the chip, and may also schedule other units to implement corresponding functions.
[0067] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0068] The present application embodiment provides a method for predicting the flow field distribution in a tunnel. The following is a detailed description of the method for predicting the flow field distribution in a tunnel according to the present application embodiment in conjunction with the accompanying drawings.
[0069] Reference Figure 4 , Figure 4 A flow chart of a method for predicting tunnel flow field distribution provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the tunnel flow field distribution prediction method may include:
[0070] Step S401: Acquire an overhead image of a target tunnel, wherein the overhead image of the target tunnel includes a target object that affects the distribution of the tunnel flow field.
[0071] Here, the target tunnel overhead image is obtained by taking a bird's-eye view of the interior scene of the tunnel.
[0072] In this embodiment, the target object includes the source of pollutants produced by combustion (ie, the pollution source). Optionally, the target object may also include a vehicle. Of course, the target object may also be other objects, such as pedestrians, etc., which are not specifically limited in this application.
[0073] Step S402: Determine the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel.
[0074] The surface distance distribution of the target object refers to the distribution data obtained based on the actual distance from each point in the overhead image of the target tunnel to the target object, and the position distribution refers to the distribution data obtained based on the position of the target object in the overhead image of the target tunnel.
[0075] Considering the different overall distribution of target objects in the tunnel, the specific distribution data of the tunnel flow field distribution caused by their influence are different. For example, when there is one vehicle in the tunnel, the movement of the vehicle has little impact on the flow pattern and velocity distribution of the air in the tunnel due to the small number of vehicles; however, if there are 10 vehicles in the tunnel, the movement of the vehicles has a great impact on the flow pattern and velocity distribution of the air in the tunnel due to the large number of vehicles.
[0076] To this end, in this embodiment, by determining the surface distance distribution and position distribution of the target object, the overall distribution of the target object in the tunnel can be better determined, and then based on its overall distribution, the specific distribution data of the flow field distribution in the tunnel corresponding to the overhead image of the target tunnel under the influence of the target object can be better predicted.
[0077] Step S403: input the surface distance distribution and position distribution of the target object into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model.
[0078] Considering that in general, there are very few sources of pollutants in a tunnel, usually only one, for this reason, in an optional embodiment, the embodiment of the present application may only consider the location distribution of the pollutant source for the pollutants, and consider both the surface distance distribution and the location distribution of the vehicle for the vehicle. That is, in the case where the target object in the overhead image of the target tunnel includes the vehicle and the source of pollutants, the surface distance distribution of the target object in the previous step may only include the surface distance distribution of the vehicle. In this case, the data input to the flow field distribution prediction model in this step is the surface distance distribution of the vehicle and the location distribution of the vehicle and the source of pollutants.
[0079] At present, in order to obtain accurate tunnel flow field distribution, in a preferred embodiment, when the target objects in the overhead image of the target tunnel include vehicles and pollutant sources, the surface distance distribution of the target objects in the previous step may include the surface distance distribution of the vehicle and the surface distance distribution of the pollutant source. Then, the data input into the flow field distribution prediction model in this step are the surface distance distribution of the vehicle, the surface distance distribution of the pollutant source, and the position distribution of the vehicle and the pollutant source.
[0080] In this embodiment, the flow field distribution prediction model can calculate the input data based on its own parameters to obtain the real distribution data of the tunnel flow field distribution when taking the overhead image of the target tunnel.
[0081] Optionally, the tunnel flow field distribution output by the model may include wind speed distribution, pollutant concentration distribution and temperature field distribution. Of course, the tunnel flow field distribution may also include others, which may be determined according to the actual scenario, and this application does not specifically limit it.
[0082] The above-mentioned flow field distribution prediction model is obtained by training using the aerial images of the training tunnel annotated with the real tunnel flow field distribution as training data.
[0083] In summary, the tunnel flow field distribution prediction method provided in the present application obtains an overhead image of the target tunnel, determines the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel, inputs the surface distance distribution and position distribution of the target object into the flow field distribution prediction model, and obtains the tunnel flow field distribution output by the model.
[0084] It can be seen that no matter how many target objects are contained in the overhead image of the target tunnel, the present application can obtain the input of the flow field distribution prediction model based on the overhead image of the target tunnel, so the flow field distribution prediction model of the present application can be applied to all dynamically changing scenes. Compared with the process of modeling and simulation calculation, the calculation speed of the flow field distribution prediction model is faster, thereby realizing the rapid prediction of the tunnel flow field distribution in the dynamically changing scene based on the flow field distribution prediction model.
[0085] In some embodiments of the present application, the process of “step S402, determining the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel” is introduced.
[0086] In order to more accurately determine the surface distance distribution and position distribution of the target object, optionally, this embodiment may first perform edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object.
[0087] Optionally, the canny edge detection algorithm can be used for edge detection. The specific process includes:
[0088] The target tunnel overhead image is smoothed using a Gaussian filter. Here, the Gaussian filter blurs the image by taking a weighted average of the pixels around each pixel to reduce the impact of noise on edge detection.
[0089] The Sobel operator is used to calculate the gradient approximation of the smoothed image. Here, the gradient amplitude and direction of each pixel in the image can be calculated. The place with the largest intensity is generally the edge.
[0090] Use two thresholds of different sizes (high threshold and low threshold, the value of the low threshold is smaller than the value of the high threshold) to detect edges, where pixels with gradient amplitude greater than the high threshold are strong edge pixels, pixels with gradient threshold between the low threshold and the high threshold are weak edge pixels, and pixels with gradient amplitude less than the low threshold are non-edge pixels;
[0091] The strong edge pixels and the weak edge pixels directly connected to the strong edge pixels are connected to obtain the complete edge of the target object.
[0092] Furthermore, after edge detection, the detected edge information of the target object can be output as a border or marked, and cv2.rectangle in the image processing library OpenCV can be called to obtain the boundary of the target object.
[0093] Finally, the image containing the boundary of the target object may be binarized to obtain a binary image marked with the boundary of the target object.
[0094] After obtaining the binary image marked with the boundary of the target object, this embodiment can determine the surface distance distribution and position distribution of the target object based on the binary image.
[0095] Specifically, based on the binary image, the process of determining the surface distance distribution and position distribution of the target object may include:
[0096] Calculate the average value of the true distance from each point in the binary image to each target object to obtain the surface distance distribution of the target object;
[0097] Different labels are added to the target objects and non-target objects in the binary image to obtain the position distribution of the target objects.
[0098] Optionally, the OCC.Core.BrepExtrema module can be used to calculate the average of the real distances from each point in the binary image to each target object to obtain the surface distance distribution of the target object. Here, each point in the binary image is a point in the tunnel; optionally, the real distance from each point to a target object can be the minimum real distance from each point to the surface of the target object.
[0099] Here, OCC.Core.BRep is a class library in Open CASCADE Technology (OCC) for surface distance distribution calculation. The OCC.Core.BRep algorithm package is a data representation method for describing the boundaries of solid objects, which decomposes the geometry into a finite number of vertices, edges, and faces. In OCC, BRep is the basic data structure for processing and manipulating geometry.
[0100] The BRepExtrema class is a tool for calculating the closest point and distance between two BRep entities. When calculating surface distance distribution, it is usually used in the following aspects: (1) Closest point calculation: determine the shortest distance between two geometric surfaces; (2) Distance distribution: calculate the shortest distance from each point on the entire surface to another surface and generate a distance field distribution.
[0101] Among them, the distance distribution mainly adopts the Proximity algorithm. The Proximity algorithm is an algorithm used to calculate the shortest distance between the surfaces of two geometric bodies. It uses geometric features such as curvature and normals, and combines numerical calculation technology to determine the distance between surfaces by calculating the minimum Euclidean distance between corresponding points. This algorithm is suitable for complex geometric models and can accurately analyze and quantify the spatial relationship between different surfaces. For example, it plays an important role in collision detection, simulation optimization, and engineering design. The calculation of distance can be simply expressed based on the Euclidean distance formula. Assuming that the set of points on the two surfaces S1 and S2 is P1 and P2, the distance distribution of the two surfaces is calculated as:
[0102] ;
[0103] in, represents the Euclidean distance, Represents the distance distribution of two surfaces S1 and S2.
[0104] Optionally, different labels are added to the target objects and non-target objects in the binary image. Taking the target objects including vehicles and pollutant sources as an example, the added labels can be: pixels located within the vehicle are marked as 0, pixels located within the pollutant source are marked as 1, and pixels located outside the vehicle and the pollutant source are marked as 2.
[0105] Of course, the added labels may be other, and this application does not specifically limit them.
[0106] In the above process, this embodiment obtains the surface distance distribution and position distribution of the target object through image calculation after edge detection. In order to make the above process more accurate, preferably, an ordinary camera rather than an infrared camera can be used to take a bird's-eye view image of the target tunnel so as to more accurately detect the boundary of the target object.
[0107] It should also be noted that no matter how many target objects are contained in the overhead image of the target tunnel, the present embodiment can obtain the surface distance distribution and position distribution of the target objects based on the overhead image of the target tunnel, and then use the surface distance distribution and position distribution of the target objects as inputs of the fluid distribution prediction model, so that the structure of the fluid distribution prediction model does not need to change with the number of target objects contained in the overhead image of the target tunnel, and is thus more suitable for scenarios where the target objects change dynamically.
[0108] In a possible implementation, in order to make the predicted tunnel flow field distribution more accurate, the present embodiment may also add a tunnel boundary distance distribution at the input end of the flow field distribution prediction model, and the tunnel boundary distance distribution may be used to describe the specific structure inside the tunnel.
[0109] In this embodiment, the surface distance distribution and position distribution of the target object and the tunnel boundary distance distribution can be input into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model.
[0110] The above-mentioned tunnel boundary distance distribution is obtained based on the overhead image of the target tunnel. Specifically, edge detection can be performed on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object, and then the average value of the true distance from each point in the binary image to the tunnel boundary is calculated to obtain the tunnel boundary distance distribution.
[0111] Optionally, the OCC.Core.BrepExtrema module may be used to calculate the average of the true distances from each point in the binary image to the tunnel boundary to obtain the tunnel boundary distance distribution.
[0112] Optionally, the real distance from any point in the binary image to the tunnel boundary may include: the real distance from the point to the upper edge of the binary image, and the real distance from the point to the lower edge of the binary image.
[0113] Of course, the actual distance from any point in the binary image to the tunnel boundary may also include other values, which are not specifically limited in this application.
[0114] In this embodiment, the combination of the tunnel edge distance distribution, the surface distance distribution and the position distribution of the target object can better reflect the actual situation inside the tunnel. Therefore, combining the three as the input of the flow field distribution prediction model can more accurately predict the flow field distribution in the tunnel.
[0115] The following embodiments introduce the structure, data flow and training process of the flow field distribution prediction model.
[0116] Optionally, the flow field distribution prediction model is a convolutional neural network model based on the UNetEx model architecture, and its specific structure is introduced as follows.
[0117] Optionally, the UNetEx encoder consists of three encoding blocks, each encoding block consists of three convolutional layers and one pooling layer; optionally, the number of filters of the three convolutional layers in the first encoding block of the three encoding blocks is 8, the number of filters of the three convolutional layers in the second encoding block is 16, and the number of filters of the three convolutional layers in the third encoding block is 32.
[0118] In this embodiment, taking the data input into the flow field distribution prediction model including: tunnel boundary distance distribution, surface distance distribution and position distribution of the target object as an example, the encoder can extract the feature information of the tunnel boundary distance distribution, the surface distance distribution and position distribution of the target object through the above three encoding blocks, and encode them into 32 feature matrices.
[0119] In this embodiment, the UNetEx encoder and the UNetEx decoder are connected through a skip connection layer. The skip connection layer extracts features from the tunnel boundary distance distribution, the surface distance distribution and the position distribution of the target object, and weightedly merges the extracted features with the 32 feature matrices output by the encoder to obtain new 32 feature matrices. After the skip connection processing, more high-resolution semantic information can be retained.
[0120] Optionally, the UNetEx decoder consists of three decoding blocks and one convolutional layer, and each decoding block consists of three transposed convolutional layers and one unpooling layer.
[0121] The UNetEx decoder decodes the new 32 feature matrices output by the jump connection layer through three decoding blocks to obtain 32 output matrices of the same size as the input, and then extracts the 32 output matrices into three feature matrices through a convolutional layer. The three feature matrices are wind speed distribution, pollutant concentration distribution, and temperature field distribution. Among them, the six distributions of tunnel boundary distance distribution, target object surface distance distribution, target object position distribution, wind speed distribution, pollutant concentration distribution, and temperature field distribution have the same size, which is the input size.
[0122] The training process of the flow field distribution prediction model is introduced below.
[0123] As mentioned above, the flow field distribution prediction model is trained using the aerial images of the training tunnel that annotate the flow field distribution of the real tunnel as training data.
[0124] In a possible implementation, this embodiment may train a flow field distribution prediction model for all tunnels. In this case, the multiple training tunnel overhead images used as training data may be images taken for multiple tunnels.
[0125] In a preferred implementation, in order to more accurately predict the flow field distribution inside each tunnel, a flow field distribution prediction model can be trained for each tunnel. In this case, the multiple training tunnel overhead images used as training data can be images taken of the same tunnel.
[0126] However, no matter which of the above implementation methods is used, it is necessary to make multiple training tunnel overhead images include different numbers of target objects. For example, taking 100 training tunnel overhead images as an example, the 100 training tunnel overhead images can be images of the actual traffic distribution and pollutant sources in the tunnel taken at multiple time periods, so that all or part of the 100 training tunnel overhead images each contain a different number of vehicles and pollutant sources.
[0127] In this embodiment, for each training tunnel overhead image, the method mentioned above can be used to obtain the tunnel boundary distance distribution (optionally, the tunnel boundary distance distribution of the same tunnel is the same, so the tunnel boundary distance distribution can be calculated only once for the same tunnel), the surface distance distribution and position distribution of the target object.
[0128] Optionally, the tunnel boundary distance distribution calculated for the same training tunnel overhead image (as mentioned above, the tunnel boundary distance distribution is an optional input), the surface distance distribution and the position distribution of the target object can be used as a set of inputs. If 100 training tunnel overhead images are included, 100 sets of inputs can be obtained.
[0129] In this embodiment, it is also necessary to determine the real tunnel flow field distribution corresponding to each training tunnel overhead image. Optionally, for each training tunnel overhead image, a CAD (Computer-Aided Design) modeling software can be used to establish a geometric model corresponding to the training tunnel overhead image, and the geometric model is consistent with the tunnel size collected by the training tunnel overhead image.
[0130] After modeling, the real tunnel flow field distribution corresponding to each training tunnel overhead image can be obtained through simulation calculation. In the simulation, the air flow, pollutant diffusion and temperature field distribution in the tunnel can be simulated by setting appropriate physical models and boundary conditions, setting the flow conditions at the entrance and exit, the thermal boundary conditions of the tunnel wall, and the location and characteristics of the pollutant release source, so as to generate detailed physical field distribution data (i.e., real tunnel flow field distribution) in each simulation run, including wind speed distribution, pollutant concentration distribution and temperature field distribution.
[0131] Optionally, a set of inputs corresponding to each training tunnel overhead image and the actual tunnel flow field distribution can be stored accordingly (optionally, the corresponding storage structure is {4,3,762,335}, 4 indicates that the stored data structure is a four-dimensional matrix; 3 indicates 3 channels. For model input, the 3 channels include tunnel boundary distance distribution, surface distance distribution and position distribution of the target object; for model output, the 3 channels include wind speed distribution, pollutant concentration distribution and temperature field distribution; 762 indicates the pixel width of each of the six distributions in the previous text, and 335 indicates the pixel height of each of the six distributions in the previous text), and stored as a file with the suffix pkl (the file with the suffix pkl is a file format commonly used in Python).
[0132] In this embodiment, the actual tunnel flow field distribution obtained by modeling and simulation calculation can be used as annotation data, and the mean of the difference between the actual tunnel flow field distribution and the tunnel flow field distribution predicted by the flow field distribution prediction model can be used as the loss function to train the parameters of the flow field distribution prediction model.
[0133] That is, for each training tunnel overhead image, a set of inputs calculated based on the training tunnel overhead image is sent to the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model; the real tunnel flow field distribution corresponding to the training tunnel overhead image is obtained by using the modeling and simulation calculation methods introduced above; the mean of the difference between the real tunnel flow field distribution corresponding to the training tunnel overhead image and the tunnel flow field distribution output by the model is calculated, and the loss value is obtained based on the mean value, and the model parameters are trained using the loss value.
[0134] Optionally, in order to ensure the reproducibility of the model output structure, the present embodiment can set the random number seed through torch.manual_seed(0) during the flow field distribution prediction model training process; optionally, the learning rate during the model training process can be set to 0.001 and the convolution kernel size can be set to 5; optionally, in order to control the complexity of the model and reduce the risk of overfitting, the AdamW optimizer can be set in this embodiment, in which the weight decay term is 0.005; optionally, the number of model iterations is 2000.
[0135] After training is completed, you can also use the test set to test the model effect. After the model accuracy meets the requirements, output the model parameters and save them.
[0136] In summary, this embodiment can ensure the training of more appropriate model parameters through modeling simulation calculation and the design of training tunnel overhead images, so that the fluid distribution prediction model can predict the tunnel flow field distribution more quickly and accurately.
[0137] A method for predicting the distribution of flow in a tunnel provided by an embodiment of the present application is introduced above. A device for executing the above method for predicting the distribution of flow in a tunnel will be introduced below.
[0138] See also Figure 5 , Figure 5 The schematic diagram of the structure of a tunnel flow field distribution prediction device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, the tunnel flow field distribution prediction device may include:
[0139] An image acquisition module 501 is used to acquire an overhead image of a target tunnel, wherein the overhead image of the target tunnel includes a target object that affects the distribution of the tunnel flow field;
[0140] An input determination module 502 is used to determine the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel;
[0141] The model prediction module 503 is used to input the surface distance distribution and position distribution of the target object into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model, wherein the tunnel flow field distribution includes wind speed distribution, pollutant concentration distribution and temperature field distribution. The flow field distribution prediction model is trained using the training tunnel aerial image with the real tunnel flow field distribution marked as training data.
[0142] The tunnel flow field distribution prediction device provided by the present application comprises an image acquisition module that acquires an overhead image of a target tunnel, an input determination module that determines the surface distance distribution and position distribution of a target object based on the overhead image of the target tunnel, and a model prediction module that inputs the surface distance distribution and position distribution of the target object into a flow field distribution prediction model to obtain the tunnel flow field distribution output by the model. It can be seen that no matter how many target objects are contained in the overhead image of the target tunnel, the present application can obtain the input of the flow field distribution prediction model based on the overhead image of the target tunnel, so the flow field distribution prediction model of the present application can be applied to all dynamically changing scenes. Compared to the process of modeling and simulation calculation, the calculation speed of the flow field distribution prediction model is faster, thereby realizing the rapid prediction of the tunnel flow field distribution in dynamically changing scenes based on the flow field distribution prediction model.
[0143] In a possible implementation, the input determination module may also be used to determine tunnel boundary distance distribution based on the overhead image of the target tunnel.
[0144] Accordingly, the above-mentioned model prediction module can be specifically used to: input the surface distance distribution and position distribution of the target object, and the tunnel boundary distance distribution into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model.
[0145] In a possible implementation, the process of the input determination module determining the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel may include:
[0146] Perform edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object;
[0147] Calculate the average value of the true distance from each point in the binary image to each target object to obtain the surface distance distribution of the target object;
[0148] Different labels are added to the target objects and non-target objects in the binary image to obtain the position distribution of the target objects.
[0149] In a possible implementation, the process of the input determination module determining the tunnel boundary distance distribution based on the overhead image of the target tunnel may include:
[0150] Perform edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object;
[0151] The average of the true distances from each point in the binary image to the tunnel boundary is calculated to obtain the tunnel boundary distance distribution.
[0152] In a possible implementation, the above-mentioned real tunnel flow field distribution is obtained by establishing a geometric model of the tunnel in the overhead image of the training tunnel and performing simulation calculations.
[0153] In one possible implementation, the target object includes a vehicle and / or a pollutant; when the target object includes a vehicle and a pollutant, the surface distance distribution of the target object includes the surface distance distribution of the vehicle, or the surface distance distribution of the target object includes the surface distance distribution of the vehicle and the surface distance distribution of the pollutant.
[0154] The tunnel flow field distribution prediction device provided in the present application and the tunnel flow field distribution prediction method provided in the previous text can be referenced to each other. For details, please refer to the previous introduction and will not be repeated here.
[0155] The present application also provides an electronic device in an embodiment. Figure 6 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0156] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0157] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0158] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any tunnel flow field distribution prediction method provided in the embodiment of the present application.
[0159] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any tunnel flow field distribution prediction method provided in the embodiment of the present application.
[0160] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0161] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0162] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0163] 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may 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 may be transmitted from a website site, a computer, a training device, or a 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, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for predicting tunnel flow field distribution, characterized in that: include: Acquire a bird's-eye view image of a target tunnel, wherein the bird's-eye view image of the target tunnel includes a target object that affects the distribution of a tunnel flow field; Based on the overhead image of the target tunnel, determining the surface distance distribution and position distribution of the target object; The surface distance distribution and position distribution of the target object are input into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model, wherein the tunnel flow field distribution includes wind speed distribution, pollutant concentration distribution and temperature field distribution, and the flow field distribution prediction model is trained using the training tunnel aerial image that annotates the real tunnel flow field distribution as training data.
2. The method for predicting tunnel flow field distribution according to claim 1, characterized in that: The step of inputting the surface distance distribution and position distribution of the target object into a flow field distribution prediction model to obtain a tunnel flow field distribution output by the model includes: The surface distance distribution and position distribution of the target object and the tunnel boundary distance distribution are input into the flow field distribution prediction model to obtain the tunnel flow field distribution output by the model, wherein the tunnel boundary distance distribution is obtained based on the overhead image of the target tunnel.
3. The method for predicting tunnel flow field distribution according to claim 1, characterized in that: The determining the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel includes: Performing edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object; Calculating the average value of the real distance from each point in the binary image to each of the target objects to obtain the surface distance distribution of the target objects; Different labels are added to the target object and non-target objects in the binary image to obtain the position distribution of the target object.
4. The method for predicting tunnel flow field distribution according to claim 2, characterized in that: The process of determining the tunnel boundary distance distribution includes: Performing edge detection on the overhead image of the target tunnel to obtain a binary image marked with the boundary of the target object; The average value of the real distance from each point in the binary image to the tunnel boundary is calculated to obtain the tunnel boundary distance distribution.
5. The method for predicting tunnel flow field distribution according to claim 1, characterized in that: The actual tunnel flow field distribution is obtained by establishing a geometric model of the tunnel in the training tunnel overhead image and performing simulation calculations.
6. The method for predicting tunnel flow field distribution according to any one of claims 1 to 5, characterized in that: The target objects include vehicles and pollutant sources; The surface distance distribution of the target object includes the surface distance distribution of the vehicle, or the surface distance distribution of the target object includes the surface distance distribution of the vehicle and the surface distance distribution of the pollutant source.
7. A tunnel flow field distribution prediction device, characterized in that: include: An image acquisition module, used to acquire an overhead image of a target tunnel, wherein the overhead image of the target tunnel includes a target object that affects the distribution of the tunnel flow field; An input determination module is used to determine the surface distance distribution and position distribution of the target object based on the overhead image of the target tunnel; A model prediction module is used to input the surface distance distribution and position distribution of the target object into a flow field distribution prediction model to obtain a tunnel flow field distribution output by the model, wherein the tunnel flow field distribution includes wind speed distribution, pollutant concentration distribution and temperature field distribution, and the flow field distribution prediction model is trained using a training tunnel aerial image that annotates the real tunnel flow field distribution as training data.
8. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the tunnel flow field distribution prediction method as claimed in any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the tunnel flow field distribution prediction method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the tunnel flow field distribution prediction method as described in any one of claims 1 to 6.