SURFACE LINE INTEGRAL CONVOLUTION-BASED VORTEX DETECTION USING COMPUTER VISION

Vortex cores in ﬂuid mechanics are easy to visualise, yet diﬃ-cult to detect numerically. Precise knowledge of these allows ﬂuid dynamics researchers to study complex ﬂow structures and allow for a better understanding of the turbulence transition process and the development and evolution of ﬂow instabilities, to name but a few relevant areas. Various approaches such as the Q, delta, and swirling strength criterion have been proposed to visualise vortical ﬂows and these approaches can be used to detect vortex core locations. Using these methods can result in spuriously detected vortex cores and which can be balanced by a cut-oﬀ ﬁlter, making these methods lack robustness. To overcome this shortcoming, we propose a new approach using convolutional neural networks to detect ﬂow structures directly from stream-line plots, using the line integral convolution method. We show that our computer vision-based approach is able to reduce the number of false positives and negatives while removing the need for a cut-oﬀ. We validate our approach using the Taylor-Green vortex problem to generate input images for our network. We show that with an increasing number of images used for training, we are able to monotonically reduce the number of false positives and negatives. We then apply our trained network to a diﬀerent ﬂow problem where vortices are still reliably detected. Thus, our study presents a robust approach that allows for reliable vortex detection which is applicable to a wide range of ﬂow scenarios.


INTRODUCTION
Vortex core detection is a challenging subject in ŕuid mechanics research and how to detect these reliably remains an open question to date.Knowing the exact location of vortex cores is useful during automated mesh reőnement in computational ŕuid dynamics simulations but provides equally valuable insights, for example, to engineers trying to optimise aerodynamic devices to channel turbulent vortices around objects to reduce drag.Identifying single vortices may be done using simple velocity gradient-based approaches, however, complex engineering applications see the merging and mixing of vortices where these simplistic approaches may fail.Knowing the precise location of vortices has far-reaching practical beneőts, yet our numerical tools are still not able to predict these vortices reliably and they produce spurious detected vortex cores, negating their usefulness.Vortices are usually identiőed based on the velocity-gradient tensor [1] and there is a range of different criteria available, among which the Q criterion [2], Lambda 2 criterion [3], the delta criterion [4], and the swirling strength criterion [5] are the most used ones and referred to here as local detection methods.While these criteria are cheap to compute, they lack robustness as they easily detect spurious vortices known as false positives (no vortex exists but is identiőed) and false negatives (a vortex exists but is not identiőed).To limit the number of false positives and negatives, the user can prescribe a threshold below which vortices are őltered.This threshold value is, however, ŕow-dependent and therefore requires re-calibration for each ŕow problem.In order to overcome this problem, we present a vortex detection method based on Computer vision.Here, we focus our attention on őnding bounding boxes that enclose vortex regions rather than exact vortex core locations.While this may seem limited at őrst, we may not need to know the exact vortex cores in order to perform local mesh reőnement (which reőnes a volume and not a single line) or track a vortex by itself (or rather its bounding box).Rather, we focus our attention here on providing a more reliable, more accurate, and more robust way of predicting vortex regions which can then be used in engineering design processes with higher conődence.Our approach can be applied to any 3D data set of vortical ŕows; as long as 2D planes through a 3D ŕow volume can be constructed through which vortices are passing through and as long as these vortices can be visualised through surface streamline plots as discussed in Section 3.3, our proposed framework will be able to identify these vortices.The advantage here is that vortices do not have to be aligned with the generated 2D planes and can pass through these at an angle, providing a more generalised approach to detect vortices.The recently introduced You Only Look Once (YOLO) [6] computer vision approach differentiates itself from similar feature detection methods by applying a single neural network to the whole image instead of making predictions on many regions within an 1 image.Moreover, it has a good balance between accuracy and speed [7,8].Therefore, it has been applied broadly to various applications such as the detection of humans [9], gesture recognition [7], and detection of objects through aerial observations [10].The algorithm has been continuously improved [11] and we use here version 3 of the algorithm.The remaining structure of this article is as follows: Section 2 reviews the literature on vortex core detection and computer vision.Section 3 introduces the methodology and tools used in the present study.Section 4 provides an overview of the numerical test case that is solved using computational ŕuid dynamics and used to produce input for our computer vision framework.Section 5 analyses how our computer vision approach compares against local vortex detection methods, and we provide a summary of the main points in Section 6.

LITERATURE REVIEW
The progress in transistor technology has established computational ŕuid dynamics as a tool to investigate turbulence ŕows down to the smallest scales of motion [12].As was alluded to in the introduction, vortices are encountered in a range of engineering and scientiőc problems where they play an important role, such as aircraft navigation during nose-up or roll of a jet [13], medical [14,15], as well as industrial applications [16].Various deőnitions for a vortex can be found in the literature [17].Lugt [18] states that ła vortex is the rotating motion of a multitude of material particles around a common centrež.This deőnition is difficult if not impossible, to implement into an algorithm [1].Robinson [19] provided another deőnition and says that ła vortex exists when instantaneous streamlines mapped onto a plane normal to the vortex core exhibit a roughly circular or spiral pattern when viewed from a reference frame moving with the centre of the vortexž.This deőnition is self-referential, as we would need prior knowledge of the location, the orientation, and the motion of the vortex core in order to identify it.Notwithstanding the lack of a formal deőnition, using available methods to identify vortices has been extensively investigated in recent years.There are two common types to detect vortices, based on local and global detection algorithms [20ś22].Local methods [2ś4] are based on the decomposition of the local velocity gradient tensor.They provide rapid results and are easy to implement.However, these methods need to carefully select suitable parameters to get robust results, which increases the time to identify vortex cores.Global vortex identiőcation methods generally utilize streamlines to identify vortex regions.The winding angle [20], instantaneous vorticity deviation [21], and elliptic objective Eulerian coherent structures method [22] are examples of global methods.In terms of robustness, global methods use neighbouring cells to identify vortical ŕows and thus tend to be more accurate than local methods, which comes at an expense of increased computational time for global methods [23].Furthermore, global methods require user input which makes them unsuitable for automatic vortex core detection tasks.Therefore, both local and global methods have both drawbacks and cannot obtain fully robust and reliable detection results.The recent advances made in the őeld of machine learning have seen a multitude of applications for physics and simulation-based problems.Li et al. [24] proposed to use a super-resolution generative adversarial network (SRGAN) to reconstruct ŕuid phase fractions in turbulent, multiphase ŕows.Ayli et al. [25] used machine learning for active ŕow control applied to the ŕow around a circular cylinder.Warey et al. [26] used conditional invertible neural networks (cINNs) to optimise shapes.They applied it to 2D airfoil generation as a classical optimisation problem.Furthermore, Nabian and Meidani [27] proposed a more generic framework for general physical systems that utilises machine learning to aid in engineering design and analysis tasks.We follow a similar approach, by adopting a machine learning approach to identify vortices in simulation data.In order to address the existing problems within traditional vortex identiőcation methods, recently Computer Vision was utilized to detect vortical structures in the ŕow őeld to obtain robust and reliable results.Many of the techniques developed in Computer Vision can be used to extract, track, and identify features [28,29].Visualisation aims to understand, analyse and identify physical phenomena or mathematical models.Therefore, the criteria for tracking features in a scientiőc area are different than for most computer vision applications.In a scientiőc simulation, evolving features may split, merge, or disappear [30].Computer vision technology has been tested using deep neural networks to solve problems of reconstruction of velocity and pressure őelds of a turbulent ŕow with high resolution and to identify the characteristic ŕow features [31].In the past decade, deep neural network (DNN)-based machine learning has shown great success in natural language processing and computer vision [32ś35] and has recently been shown to be able to identify vortical ŕows.Lguensat et al. [36] utilized a DNN to identify ocean eddies from sea surface height maps.They considered the entire visualization images of the ŕow őeld as inputs to detect the ocean eddies.Franz et al. [37] used a convolutional neural network (CNN) to detect and track ocean eddies and provided the labelled training data by local vortex identiőcation that need suitable parameters to get robust results.Similarly, Ströfer et al. [38] developed a CNN for identifying the horseshoe vortices in a 3D ŕow over a wing-body junction.Deng et al. [39] presented a vortex identiőcation method based on a CNN.They used the global instantaneous vorticity deviation method of Haller et al. [21] and a local method to obtain the labels of each point in the ŕow őeld for training.The local vortex detection methods are used to identify vortices and train the network which can be automated in this way.However, local methods are prone to provide spurious vortices and thus the network may be trained based on false positives and negatives.Expanding on the work of Deng et al., we propose an alternative way to use CNN to track and identify vortical structures.We replace local detection methods for labelling by manually tagging vortices on streamline plots.While this requires a substantial manual upfront cost, this needs to be done only once and with sufficient vortices labelled for different ŕow situations, a trained network can be applied for various ŕow scenarios.By adopting this approach, we are able to eliminate false positives and negatives and thus increase the overall robustness and accuracy of CNNs for vortex identiőcation tasks.This approach is detailed in the next section.

METHODOLOGY
In the following section, we introduce and provide a brief description of the underlying methods we make use of in this study.We introduce the Navier-Stokes equations in the form it is solved for our turbulent ŕow, provide a description of local vortex detection algorithms as well as propose our computer vision-based approach to detect vortices based on the line integral convolution method.

Governing equations for incompressible computational fluid dynamics
The motion of ŕuids is entirely described by the Navier-Stokes equations.It is a set of conservation laws, namely conservation of mass, momentum, and energy and provides in total a set of őve equations and six unknown quantities (density, pressure, energy (temperature), and three velocity components in the x-, y-and z-direction).For a compressible ŕuid (that is, with a variable density), we can close the Navier-Stokes equations through a suitable state equation such as the ideal gas law.For an incompressible ŕuid, such as we are considering in this study, the density is constant, and no such relation exists.In this case, various pressure-velocity coupling schemes have been proposed that work in a predictor-corrector fashion and iteratively őnd the solution to a given problem, of which the SIMPLE scheme of Patankar [40] is one of the most widely used one.The conservation of momentum is given by where U is the velocity vector (  ,  ,  ),  the density,  the time,  is pressure,  is dynamic viscosity and  and  being the rate-of-strain and stress tensor, respectively.The rate-of-strain tensor can be deőned in tensor notation as and the stress tensor as The conservation of mass, in turn, is given as In the equations above, we have spatially őltered the Navier-Stokes equations where small-scale turbulence features that are smaller than a őlter width Δ have to be modelled through a subgrid-scale model.The őltering operation produces a stress tensor  that is commonly modelled with the relation provided in Eq.( 3), where we can ignore the contribution of   .We replace the turbulent stresses through the strain-of-rate tensor  which is scaled by the turbulent subgrid-scale viscosity and which in turn accounts for the őltered smallest turbulent eddies.As we are now only resolving the largest turbulent ŕow structure and modelling the smallest scale, this approach is referred to as large-eddy simulations or LES in short.Using LES to resolve turbulence and thus vortical ŕows, we have to introduce a subgrid-scale model [41] to calculate the turbulent viscosity to close the set of momentum equations, i.e.Eq. (1).In this study, we make use of the Smagorinsky-Lilly [42] model which is given by where   is an empirical constant and tuned for a range of canonical turbulent ŕows and Δ the őlter width below which turbulent eddies are őltered (typical related to the local mesh size).The advantage of LES is that we can generate turbulent vortical structures quickly while only removing the smallest length scales which can be easily modelled.The alternative is to model the full turbulent ŕow őeld which still requires signiőcant computational resources.In this case, we do not őlter the Navier-Stokes equations but instead ensure that our computational grid can capture all turbulent length scales (in which case the stress tensor  does not need to be modelled and can be computed directly from the resolved velocity őeld).This approach is referred to as direct numerical simulations or DNS in short.Since we are only interested in detecting macroscopic vortical structures, LES provides excellent accuracy and sufficient information about turbulent ŕows, which is suitable to capture vortices for training our CNN.Therefore, LES has been used in this study to generate data quickly.

Local vortex identification methods
The detection methods rely on the velocity gradient tensor, ∇, that can be written as where  = 1, 2, 3 for   and   correspond to x, y, z and u, v, w, respectively.The velocity gradient tensor    can be decomposed into a symmetric and anti-symmetric tensor as and where    is the symmetric part of the velocity gradient tensor which is commonly known as the rate-of-strain tensor and Ω is the anti-symmetric component representing the rate of rotation tensor.The characteristic equation for  is given as [43] where P, Q, and R are the őrst, second, and third invariants of the velocity gradient tensor.Using the decomposition into symmetric and anti-symmetric tensors, these invariants can be expressed as Here we have ||∥ = [tr (  )] .The , delta, and swirling strength criteria are the most common local detection methods based on the velocity gradient tensor    .The Q criterion (Hunt et al. [2]) identiőes vortices as ŕow regions with the positive second invariant of ∇, i.e.  > 0. The delta criterion is using the critical point theory of Chong et al. [4] and deőnes a vortex core for regions where    has complex eigenvalues.These are identiőed using the discriminant of the characteristic equation, which is given by In a strict mathematical sense,  is set to zero which can result in falsely detected vortices.To reduce these false positives, we can prescribe a value of  > 0 which increases the accuracy of the model but reduces the robustness of this method, as  is a parameter speciőc to each vortex.Setting  too low results in vortices that are detected in areas where no vortices exist (false positive).A value of  too high results in vortices that are not detected even though they exist in physical space (false negative).The Swirling strength criterion of Zhou et al. [5] is similarly deőned to the delta criterion as the region where    has complex eigenvalues.Unlike the delta criterion, however, Zhou et al. [5] used the velocity gradient decomposition as follows Here,   is deőned as the real eigenvalue which is related to the real eigenvector   and we have the conjugate pair of complex eigenvalues   ±   which is related to the corresponding eigenvectors   ±   .The local swirling strength of a vortex is deőned through   and for values greater than zero, a vortex is identiőed.This deőnition, however, produces similar falsely detected vortices, and thus a more conservative approach would be to deőne   > .Using this approach, we need to őne-tune the threshold parameter  which is again a vortex speciőc parameter.Due to the singular nature of the threshold parameter, we are not able to avoid the detection of false positives and negatives, as vortices may be cut-off below the threshold or spurious vortices are allowed to be detected above the threshold.The above described vortex detection methods were implemented by Lindner et al. [43] into their Vortex Fitting toolbox.We use this toolbox to detect vortices by őne-tuning the threshold parameter  for each case individually.As we will show, the results are highly dependent on  and despite searching for the optimum threshold value, false positives and negatives still exist.In order to overcome this shortcoming, we introduce a computer vision approach based on streamline-based vortex detection to reduce false positives and negatives.

Streamline detection using the line integral convolution algorithm
As the input to our computer vision framework, we generate streamline plots on predeőned planes within our computational domain where we extract the velocity vector and compute from it the local streamlines for each pixel using the line integral convolution (LIC) algorithm, as proposed by Cabral and Leedom [44].
This technique starts by covering a surface with a random grayscale value at the resolution at which streamline plots are to be generated.It then computes the following integral where  () represents the colour value at location ,  being the arc length along the streamline,  () is an appropriately chosen kernel function to limit colouring to local space and  (()) containing the gray-scale image.We integrate along the streamline d for a distance .We apply this for each pixel in the domain which produces LIC plots as shown in Figure 6.Compared to traditional streamline plots, LIC streamline plots provide the advantage of covering the entire image whereas traditional streamline plots require a starting location through which streamlines have to pass, which does not guarantee full coverage of the domain.Furthermore, in 3D, streamlines may leave a 2D plane on which visualisation is sought, making it a difficult task to generate surface streamline plots and extract vortex cores automatically.We generate these LIC streamline plots using ParaView and these are then further pre-processed using the Torchvision module Ð which is part of the PyTorch Python package Ð by applying rotation, cropping, and horizontal or vertical ŕipping to the images to make the training more robust.To construct the training and validation data set, the planes were randomly chosen at −/2, 0, or /2 in the , , or  direction.For our supervised learning approach, we manually label vortex regions for 100 images where we identiőed a total of 1646 vortices.While this step represents a time-consuming step, it has to be done only once.We later show that this approach can then be transferred to different ŕuid problems for which no training has taken place and vortices can still be detected reliably.

Computer vision-based vortex detection with YOLO
Computer vision is a sub-őeld of artiőcial intelligence that is able to extract meaningful information from digital images and videos.In our case, we use it to extract vortices from streamline plots.In this work, we used YOLO version 3 [11] for enhancing the vortex core detection accuracy and reducing false positives and false negatives.YOLO passes the entire image into a Neural Network.This Neural Network divides the image into cells and provides probabilities for every cell.Then YOLO predicts the number of Bounding Boxes within the image and chooses the best ones based on the probabilities.The backbone network of YOLO v3 is called Darknet-53, which has 53 CNNs layers, to extract feature images from the input.The basic components of YOLO's architecture are shown in Figure 1 and consist of residual blocks, skip connections and up-sampling layers, where each convolutional layer is followed by a batch normalisation layer and Leaky ReLU activation function.YOLO uses three different resolutions, which are responsible for detecting objects of different scales, and at three separate places in the Network.Therefore, the original architecture of YOLO adds 53 additional layers and yields 106 layers for detection tasks.These separate places for detection are layers 82, 94, and 106.The size of the image input is divided by the network into 32, 16, and 8 [45] and referred to as the network's stride.Therefore, the input image to the Network

FIGURE 1: YOLOV3 ARCHITECTURE WITH INPUT IMAGE SIZE 416×416 AND 3 TYPES OF SCALES (13×13, 26×26, AND 52×52) AS OUT-PUT; DARKNET-CONV2D-BN-LEAKY ("DBL" FOR SHORT) IS THE MAIN COMPONENT OF YOLOV3 WHICH CONTAINS ONE CONVOLUTION LAYER, ONE BATCH NORMALIZATION LAYER, AND ONE LEAKY RELU LAYER.; RESIDUAL-LIKE UNIT ("RESUNIT" FOR SHORT) IS TWO "DBL" STRUCTURES FOLLOWING ONE "ADD" LAYER; SEVERAL "RESUNIT" WITH ONE ZERO-PADDING LAYER AND "DBL" STRUCTURE FORWARD GENERATES A RESIDUAL-LIKE BLOCK, "RESBLOCK" FOR SHORT, WHICH IS THE MODULE ELEMENT OF DARKNET-53. FIG-URE ADAPTED FROM WANG ET AL. [45] FIGURE 2: DIFFERENT LABELLING STRATEGIES: ON THE LEFT-HAND SIDE, WE USE NON-OVERLAPPING BOUNDING BOXES AND ON THE RIGHT-HAND SIDE WE ALLOW LABELLED BOUNDING BOXES TO OVERLAP, CAPTURING MORE OF THE VORTICES' STRUCTURES.
must be divisible by 32 without leaving a remainder, in our case the size of the input image is 416 pixels.Stride 32 will produce an output size of 13 by 13.Similarly, stride 16 will produce an output of size 26 by 26 and stride 8 of 52 by 52.Therefore, strides 8, 16, and 32 are responsible for detecting small, medium, and large features in our images, respectively.In contrast, the previous versions (YOLOv1,YOLOv2) had difficulty detecting small objects since the images were divided into equal-sized grid cells with each grid cell detecting object if the central point of the object fell into that cell.YOLOv4 and subsequent versions generate the same three different outputs of feature maps as YOLOv3 to achieve multi-scale prediction.In terms of accuracy, YOLOv4 and above may achieve slightly better accuracy than YOLOv3, especially in the MS COCO dataset, however, YOLOv3's detection speed is faster than that of YOLOv4 and versions above [46].For that reason, we have chosen to use YOLOv3 in this study to detect vortex regions with good speed and high accuracy which is suitable to detect small areas of vortices.

Vortex regions labelling
Labelling of vortices poses some difficulties and needs to be considered carefully in order to avoid false positives and negatives.As vortices are not well-deőned structures (where does a vortex start and where does it end?), we have implemented two different labelling strategies and compared their effect on the results.Both strategies are schematically shown in Figure 2. On the left-hand side, we show an approach in which the bounding boxes we use for labelling do not overlap.This ensures that each bounding box only considers one vortex and the inŕuence from a close neighbouring vortex does not bleed into this bounding box.On the right-hand side, we do allow the labelled bounding boxes to overlap and concentrate here on capturing as much of the vortex as possible.This allows for neighbouring vortices to affect vortex detection.The idea here is that neighbouring vortices will have an effect on the shape and structure of the vortex itself and using this approach may help in predicting vortices of non-perfectly spherical shape better.

TEST CASE
We use the Taylor Green Vortex problem as a test case.The Taylor-Green vortex ŕow is simulated using LES at a Reynolds number of Re=1600 [47].The large-scale turbulence is solved directly using the Navier-Stokes equations, and the small-scale turbulence is modelled using the Smagorinsky-Lilly subgrid-scale model.The geometry has been discretized by a uniform mesh of resolution 64 3 with a time-step of Δ * ≈ 0.06, which corresponds to a CFL value of 0.6.Here, we use the non-dimensional time  * which is expressed as  * =  0 /.All six sides of the cube of length 2 (with  = 1) are set to periodic boundary conditions.The initial conditions are set in such a way that an initial distribution of large, energy-containing vortices exists which then decays through vortex stretching in three-dimensional space.The initial conditions are given by Here, we set  0 = 1   −1 ,  0 = 0  and  0 = 1   −3 .Setting the kinematic viscosity to  = 1/1600  2  −1 then results in the desired Reynolds number of Re=1600.The left-hand side of Figure 3 shows the vortex distribution at  * = 0 using the magnitude of the velocity vector.The right-hand side shows the state of the velocity vector at  * = 20, after vortex stretching has redistributed the containing energy in space, with the energy contained at the smallest turbulent scales being dissipated into heat.From Figure 3, we can see that a range of vortices will develop from the initial conditions and this will provide us with a reliable mechanism to generate vortical ŕow patterns from which we can extract streamlines on the symmetry planes of the x-, y-and z-direction which are then used training data for our computer vision-based framework.
To validate our simulation setup, we run the Taylor-Green vortex problem until  * = 20 and compare the computed overall kinetic energy with that of Beck and Gassner [48] and DeBonis [49].The temporal evolution of kinetic energy, based on the instantaneous velocity vector, is computed as The temporal evolution of the kinetic energy dissipation rate is computed as These two quantities are plotted and compared against reference data in Figure 4 and Figure 5, respectively.We compare our data here against direct numerical simulation (DNS) results, as well as LES results done on the same mesh size as our simulation.
From Figure 4, we can see that our results prematurely capture an increase in dissipation rate compared to the DNS results.However, this trend is explained by the coarse resolution of the 64 3 grid cells in our simulation.Comparing our results against LES data obtained on a similar grid shows that we match that data much better.Looking at Figure 5, we capture the kinetic energy temporal evolution well and there are only minute differences between the LES and DNS reference data.It should be stressed here that our primary concern is to generate vortical structures quickly while capturing the overall physical process of turbulence and its decay.Our validation shows that this is the case here and that we can proceed with these simulations to generate our streamline plots for the vortex core detection task.

RESULTS AND DISCUSSIONS
A total of 335 time steps are required to advance the solution from  * = 0 to  * = 20 at   = 0.6.We store the velocity vector on the symmetry planes in the x-, y-and z-direction at each time-step.In the current investigation, we extract a total of 100 images from the symmetry plane norm to the x, y, and zdirection as training dataset and label vortices on these 100 images based which are visualised through the line integral convolution method.We then select two additional images from the symmetry plane, which are not part of the training data set, and use that for testing the accuracy of our vortex detection framework based on computer vision.The two images are shown in Figure 6, where test image 1, on the left-hand side, contains 16 vortices, and test image 2, on the right-hand side, contains 24 vortices.We observe that the test images contain mostly symmetrical vortex structures along the main axes.

FIGURE 3: CONTOUR VELOCITY PLOT. THE LEFT-HAND SIDE AT THE BEGINNING INITIAL STATE AND THE RIGHT-HAND SIDE AT THE END TIME STEP. FIGURE 4: KINETIC ENERGY DISSIPATION RATE. THE REFER-ENCE LARGE EDDY SIMULATION (LES) AND DIRECT NUMERICAL SIMULATION (DNS) WAS TAKEN FROM [48], THE CURRENT SIMU-LATION RESULTS SHOWN IN THE DASHED BLUE LINE WERE OB-TAINED USING LES ON A 64 3 GRID AT A REYNOLDS NUMBER OF RE=1600.
First, we will use these two test images to detect vortices using the Vortex őtting toolbox of Lindner et al. [43] and show results for that in the next section.Then, we apply the same test images to our trained computer vision-based framework and show how the number of images used for training inŕuences the accuracy.

Local vortex detection methods
Figure 7 and Figure 8 show the results of the two test images after detecting vortices using the Vortex őtting toolbox [43].We use the Q, delta, and swirling strength criterion here and vary the numerical discretisation schemes used to approximate the derivatives within the velocity gradient tensor.Here, we use second-order, fourth-order, and a least square gradient reconstruction approach.Furthermore, we őne-tune the threshold value to match the number of expected vortices for both cases, here 16 for test image 1 (Figure 7) and 24 vortices for test image 2 (Figure 8).This is only possible for the delta and swirling strength criterion, whereas the Q criterion does not allow for a threshold to be őne-tuned.
Here, the yellow dots in the images indicate clockwise rotat-

FIGURE 5: TEMPORAL EVOLUTION OF THE TURBULENT KINETIC ENERGY. THE REFERENCE LARGE EDDY SIMULATION (LES) AND DIRECT NUMERICAL SIMULATION (DNS) WAS TAKEN FROM [49], THE CURRENT SIMULATION RESULTS SHOWN IN THE DASHED BLUE LINE WERE OBTAINED USING LES ON A 64 3 GRID AT A REYNOLDS NUMBER OF RE=1600.
ing vortices, the green dots indicate counter-clockwise rotating vortices and the red dots show the actual location of vortex cores, which were manually extracted from Figure 6.Both Figures show a similar behaviour in terms of performance for the three different detection algorithms.First of all, there is little coherence between the different methods and, to some extent, there is also a lack of coherence between the different gradient reconstruction schemes for the same method.What is interesting to note is that despite providing an almost symmetrical ŕow őeld to the vortex detection algorithms, this symmetry is not reŕected in the predicted vortices.Some detection algorithms tend to a more symmetrical vortex core prediction but overall a non-symmetrical prediction pattern is established.This shows the sensitivity of the different methods to the threshold parameter  (for the delta and swirling strength criterion) as őne-tuning this may remove some of the mirrored vortices due to a slight difference in vortex strength.Furthermore, we can observe that all these detection methods provide, at best, an approximation of actual vortex core regions.It can be noted from a qualitative point of view, that the delta criterion seems to predict regions of high vortical ŕow correctly, despite not being able to predict the

TABLE 1: NUMBER OF PREDICTED VORTICES FOR THE Q, DELTA, AND SWIRLING STRENGTH CRITERION USING A SECOND-ORDER GRADIENT RECONSTRUCTION SCHEME, AS WELL AS THEIR FALSE POSITIVES AND NEGATIVES AND THE THRESHOLD VALUE REQUIRED TO MATCH THE NUMBER OF PREDICTED VORTICES TO THE NUMBER OF EXPECTED VORTICES (EV)
Second    exact location of vortex cores.This is especially noticeable for the second test image.Both the Q and swirling strength criterion are picking up on the rotational ŕow at the centre; we may have vortical ŕow here but within the plane we are observing the ŕow, the centre part of the streamlines cannot be classiőed as a vortex.Overall, we can say that we get a good initial prediction of areas where vortices are located but tracking down their precise location proves difficult.Without manually detecting where vortices are located, it is also difficult to judge if the reported results are physical or contain false positives and negatives.Turning to Table 1ś3, these summarise how the different methods compare in terms of predicting false positives and negatives for the three different gradient reconstruction schemes.Here, we count vortices as being correctly predicted if they are in the vicinity of an actual vortex core.These three tables provide in numbers what has been discussed above but further show that a large number of false positives and negatives exist for all detection algorithms and reconstruction schemes and, apart from the Q criterion, we can see that arriving at these values requires őne-tuning of the threshold parameter which does not follow any identiőable pattern.
In order to quantify the spread of the vortex core detection of these local detection methods, we compute the root mean square error of all predicted vortices to the closest actual vortex that is present in the domain using Where  is the total number of predicted vortices,   the predicted vortex core and ˆ︁   being the vortex that is present in the domain and closest to   .Here,   represents the yellow and green dots in Figure 7 and Figure 8, while ˆ︁   is represented by the red dots.The results are shown in Table 4. Interestingly, this Table shows that the smallest and highest errors are obtained using the delta criterion using the second-and fourth-order gradient reconstruction scheme for test images 1 and 2, respectively.This is conőrmed by taking the variance of all the results for each method where we have a variance of 5.5−3, 7.9−4, and 6.4−4 for the delta, Q, and swirling strength criterion, respectively.While the delta criterion does indeed provide an overall good prediction of the vortex core regions for test image 2, its prediction for the őrst test image is rather scattered.We can see that the swirling strength does not provide overall the lowest errors, but it is the most consistent method which has the lowest variance.The Q criterion performs similarly to the swirling strength in terms of overall errors and achieves this without the need to őne-tune the threshold parameter.Therefore, the Q criterion may be seen as a good compromise which may explain its popularity in the computational ŕuid dynamics community to visualise vortices, however, it still produces false positives and negatives.For each criterion, the maximum distance between the actual vortex cores and the predicted location is shown in Table 5 with the second-order, fourth-order, and least square gradient schemes.The maximum difference between all predicted vortices and the actual vortices in the domain is calculated as follows: Δ  represents the difference between the predicted and actual of a vortex core in x direction, while Δ  represents the difference between the predicted and actual of a vortex core in the y direction.Based on Table 5, the Q criterion with the second-order scheme has the highest maximum distance value for test image one, as well as the highest RMSE value on the table 4. In test image 2, the highest maximum distance value is obtained with the second-order scheme of Q, delta, and swirling strength cri- terion.Table 4 also shows they have the highest RMSE value.The spread between the data is low, suggesting that all methods provide a similar difference in terms of maximum difference to the actual vortex cores.Next, we show that using computer vision can remove the need to specify this free parameter while reducing the false positives and negatives entirely.

Detecting vortices through computer vision
As we noted in the introduction, we focus here on predicting vortex regions (i.e.bounding boxes of vortices) and not the vortex cores themselves.This distinction is important as the test case that we employ is unsteady.For unsteady ŕows, the vortex core may not be inferred from streamline such as LIC surface streamline plots but rather path-lines must be studied.However, while the centre of rotation may be different, the vortex region remains approximately the same.Thus, by focusing on the bounding box of the vortex, we do not limit ourselves to studying only steady-state ŕows.This has the advantage that we can use simple geometries such as the Taylor-Green vortex problem which can produce vortices easily and in a wide range of sizes and shapes.In order to show how we are able to reduce false positives and negatives using computer vision, we train our YOLO-based CNN in a sequence of 12  Our results indicate that whichever labelling method is used has no effect.Hence, we will discuss the overlapping bounding boxes as shown in őgure 9 in the rest of this section since the bounding box labelling captures the entire vortex region, and the labelling way doesn't inŕuence the results.Focusing on sequence 1 for the őrst test image (top left) in őgure 9 , we can see that a total of 11 vortices are predicted.4 out of these 11 vortices are false positives and should be removed while there are 9 false negatives, i.e. vortices that are present but not detected.Moving to the right, i.e. increasing the number of images used in the sequence, we can see that we detect increasingly more vortices for sequences 6 and 12 and that we reduce the number of false positives and negatives entirely with a sufficiently large training set.Similar observations can be made as well for the second test image.Table 6 and Table 7 provide tabulated data about the reduction in false positives and negatives for each sequence of images.We can see that for test image 1 in Table 6 that it takes 60 images for training to reliably detected all physical vortices without detecting any spurious vortices.For test image 2 in Table 7, we can see that it takes the full training set of 100 images to reduce all false positives and detect all physically present vortices correctly.This trend is shown also in Figure 11, where we plot the false negatives against the number of images used for training.We can see a monotonic decrease.We train our CNN on a single Nvidia V100 GPU and provide training times for both tables.Since both test images rely on the same 100 images that we use for training, we perform this step only once and hence have the same training times in both tables, here provided only for completeness.Table 6 and Table 7 also provide the mean Average Precision (mAP) and we train our model for each sequence until we reach a value of 0.9 except for the last sequence, where we increase the value to 0.96 to capture all vortices.Figure 12 shows that a few epochs are required initially to pick up any vortices after which we can observe a steady increase in the mAP value.
To obtain the mAP we need to calculate the Precision (measures the accuracy of the predictions) and Recall (measures how well all the true positives are found), which are deőned as We count true positives as those identiőed vortices (red bounding boxes) that share an intersection over union (IoU) with the ground truth bounding box (the bounding box that is manually created to label vortices) which is above an IoU threshold value of 0.5 in our case.False positives and negatives take the same deőnition as in Table 6 and Table 7.We obtain Precision and Recall using IoU values for a given IoU threshold.Then we calculate the average of the area under the precision and recall curve.The error between the target value and the predicted value is calculated by the loss function, using the concept of error backpropagation in the neural network and altering the weight of each layer in the network to achieve the training of the model.During training, we calculate the loss function by summing the localisation loss (errors between the predicted bounding box and the truth bounding box), the classiőcation loss, and the conődence, as deőned in [6,50].Figure 13 shows a monotonic decreasing loss function and we can say that after about 300 epochs, that our CNN is well őtted.

Application to turbulent boundary layer flows
Thus far, we have concentrated on homogeneously decaying turbulence in a box in Section 5.1 and Section 5.2.However, real ŕuid-dynamics applications feature a range of complex ŕow structures, in which hair-pin vortices, dean vortices, Gortler-Taylor vortices, jets, and streaks can occur (to name but a few).Therefore, the purpose of this section is to explore how our developed framework performs in cases with such structures.We investigate a case in which a turbulent boundary layer is developed over a ŕat plate that does feature, for example, streaks and hairpin vortices.Here, we use the LES data of Szöke et al. [51], where the turbulence within a channel with streamwise rods was simulated to investigate their role to attenuate pressure ŕuctuations near the wall.As the turbulent boundary layer is forming along the wall, we expect a ŕow structure to develop which our Taylor-Green Vortex setup did not contain.Thus, our trained framework has not seen any such structures during training.However, their vortical appearance may be similar enough so that vortices will be detected, regardless of their underlying shape.This investigation is performed to provide evidence of the universal nature of this framework.Figure 14 shows the streamlines taken from the numerical data in [51].This is looking straight onto the rods, where the bottom part is assigned a wall boundary condition (and hence this is where fundamentally different vortical structures are expected).Both the left and right sides are assigned periodic boundary conditions and the top is a slip wall.We use here our trained CNN and we can see that the vortices are still detected with good accuracy.We can spot at least one false negative below the right rod and at least one false positive in the bottom left corner, however, overall we are able to predict the correct vortex region and using additional images from turbulent boundary layer ŕows, it is likely that we will be able to remove false positives and negatives entirely.In addition, using different types of ŕow which produce different types of vortices will reduce the risk of over-őtting.In our case, the Taylor-Green Vortex problem produces a wide range of vortices but additional training would beneőt the overall robustness for a different type of ŕows here.
For completeness, we also employ the Q, delta, and swirling strength criterion which is shown in Figure 15.Similar to observations made before, we can see that the results are scattered with false positives and negatives and that we have to őne-tune the threshold parameter.There is little coherence between the different methods and the computer vision-based approach provides better predictions, despite a lack of training for this particular case.Thus, these results suggest that our developed computer vision framework has a universal nature and can be applied to ŕow cases for which it has not been trained for.However, providing additional training would allow to detect even more features for attached, turbulent boundary layer ŕows and identify some vortices which are currently not detected.

CONCLUSIONS
We have presented a new computer vision-based approach to detect vortex cores in ŕuid dynamic applications through line integral convolution-based streamline plots.We used these streamline plots to train a convolutional neural network based on the YOLO algorithm.To test our new algorithm, we have performed large-eddy simulations of the Taylor-Green vortex problem at a Reynolds number of 1600 and extracted surface plots at the symmetry plane of the domain.We compute the bounding boxes of the vortex core regions and show that we are able to remove the false positives and negatives entirely for the Taylor-Green problem, regardless of the labelling procedure.We have also applied the trained network to a test case for which it has not been trained and found that most vortices are correctly detected, with only a few false positives and negatives.These may be further removed through retraining using additional input images.We have also employed classical local vortex detection algorithms based on the Q, delta, and swirling strength criteria.We have shown that these methods are able to approximate the region of vortex cores.There are a number of false positives and negatives that are generated and the őne-tuning of a threshold parameter is required to keep the number of detected vortices bounded.Thus, local vortex detection algorithms require a priori knowledge of the ŕow őeld to set up the correct threshold parameter but even then produce spuriously detected vortex cores.We show that using our computer vision-based algorithm that we are able to remove these entirely.
While we are able to remove false positives and negatives, our computer vision approach only provides bounding boxes of vortex regions.To extract the precise vortex core, one could extend our approach through a hybrid computer-vision and deep neural network approach or a modiőed local vortex core detection algorithm that only searches in detected vortex core regions.We leave these to future work activities.

( a )
T es t i m ag e 1 w i th 16 v or ti ces .(b) T es t i m ag e 2 w i th 24 v or ti ces .

FIGURE 6 :
FIGURE 6: TEST IMAGES SHOWING VORTICAL STRUCTURES OBTAINED WITH THE LINE INTEGRAL CONVOLUTION-BASED STREAMLINE ALGORITHM.

FIGURE 7 :
FIGURE 7: DETECTED VORTICES (SHOWN ON YELLOW AND GREEN) USING THE Q, DELTA, AND SWIRLING STRENGTH CRITERION WITH SECOND-ORDER, FOURTH-ORDER, AND LEAST SQUARE GRADIENT RECONSTRUCTION SCHEMES FOR THE FIRST TEST IMAGE (16 VOR-TICES).THE ACTUAL VORTEX CORE REGIONS ARE SHOWN BY THE RED CIRCLES.

FIGURE 8 :
FIGURE 8: DETECTED VORTICES (SHOWN ON YELLOW AND GREEN) USING THE Q, DELTA, AND SWIRLING STRENGTH CRITERION WITH SECOND-ORDER, FOURTH-ORDER AND LEAST SQUARE GRADIENT RECONSTRUCTION SCHEMES FOR THE SECOND TEST IMAGE (24 VORTICES).THE ACTUAL VORTEX CORE REGIONS ARE SHOWN BY THE RED CIRCLES.

S = 1 Test Image 1 S = 6 Test Image 1 S = 12 Test Image 1 S = 1 Test Image 2 S = 6 Test Image 2 S = 12 Test Image 2 FIGURE 9 :
FIGURE 9: THE OUTPUT RESULT OF S=1 (1 IMAGE), S=6 (40 IMAGES) AND S=12 (100 IMAGES).THE RED BOX IS THE PREDICTED BOUNDING BOX BASED ON BOUNDING BOXES THAT ARE ALLOWED TO OVERLAP DURING LABELLING, SEE SECTION 3.5.

S = 1 Test Image 1 S = 6 Test Image 1 S = 12 Test Image 1 S = 1 Test Image 2 S = 6 Test Image 2 S = 12 Test Image 2 FIGURE 10 :
FIGURE 10: THE OUTPUT RESULT OF S=1 (1 IMAGE), S=6 (40 IMAGES) AND S=12 (100 IMAGES).THE RED BOX IS THE PREDICTED BOUND-ING BOX BASED ON BOUNDING BOXES THAT ARE NOT ALLOWED TO OVERLAP DURING LABELLING, SEE SECTION 3.5.
steps, each sequence containing an increasing number of images used for labelling of vortices which are then used for training.The őrst sequence contains a single image for training which is then increased to 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100 images.The number of vortices that are manually labelled in each sequence are 18, 106, 202, 394, 562, 722, 926, 1086, 1246, 1326, 1486 and 1646, respectively.Using both test images, Figures 9 and őgures 10 depict the evolution of training with overlapping and without overlapping bounding box labelling techniques, respectively, for sequence 1 (1 image), sequence 6 (40 images), and sequence 12 (100 images).The detected vortices are identiőed through a corresponding red bounding box.

FIGURE 11 :
FIGURE 11: (THE BLACK SOLID AND BLUE DISH) FALSE NEGA-TIVES CURVES FOR TEST IMAGE 1 AND TEST IMAGE 2 RESPEC-TIVELY IN THE NUMBER OF IMAGES.

FIGURE 12 :
FIGURE 12: MEAN AVERAGE PRECISION CURVE IN THE TIME OF TRAINING EPOCHS

FIGURE 13 :
FIGURE 13: LOSS VALUES CURVE IN THE TIME OF TRAINING EPOCHS.

FIGURE 15 :
FIGURE 15: DETECTED VORTEX CORES USING THE Q, DELTA AND SWIRLING STRENGTH CRITERION WITH DIFFERENT GRADIENT RECONSTRUCTION SCHEMES FOR THE TURBULENT BOUNDARY LAYER CASE TAKEN FROM SZÖKE ET AL. [51]

TABLE 7 : NUMBER OF DETECTED AND EXPECTED VORTICES FOR THE SECOND TEST IMAGE, AS WELL AS FALSE POSITIVES AND NEGATIVES WITH AN INCREASING NUMBER OF IMAGES USED FOR TRAINING. THE COMPUTATIONAL TIME TAKEN FOR TRAINING IS PROVIDED ALONG WITH THE MEAN AVERAGE PRECISION (MAP)
FIGURE 14: DETECTED VORTEX CORE REGIONS USING OUR COMPUTER VISION APPROACH FOR THE TURBULENT BOUND-ARY LAYER CASE TAKEN FROM SZÖKE ET AL. [51]