A real-time crowd evacuation simulation method based on computer vision
By locating pedestrians through computer vision and combining it with a cellular automaton model for real-time evacuation simulation, the problem that existing models cannot perform real-time analysis is solved, efficient evacuation simulation and evacuation strategy generation are achieved, and evacuation efficiency and safety are improved.
Patent Information
- Application Number
- CN202211466723.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-11-22
AI Technical Summary
The existing evacuation simulation model is unable to perform real-time analysis and generate evacuation strategies, and is unable to perform real-time evacuation simulation based on the actual distribution of personnel and emergency scenarios. The lack of real-time evacuation simulation function makes it of little practical significance.
Computer vision is used to locate pedestrians, and their positions are imported into the cellular automaton evacuation model. Three-dimensional spatial positioning is performed through monocular machine vision, and a two-dimensional cellular automaton model of the evacuation scene is established to perform real-time evacuation simulation.
It realizes real-time evacuation simulation based on the actual distribution of pedestrians, improves the authenticity and efficiency of evacuation simulation, provides a scientific basis for the safe evacuation of crowds, optimizes the actual evacuation process, detects the evacuation performance of buildings, and improves evacuation efficiency.
Smart Images

Figure CN115830530B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of emergency evacuation route planning and design, and in particular relates to a real-time crowd evacuation simulation method based on computer vision. Background Art
[0002] With economic development and urbanization, a large number of complex urban public spaces have emerged, such as subway stations, stadiums, school buildings, and employee areas in large office buildings. These public spaces attract large crowds, creating densely populated areas. Public safety in these crowded areas poses significant challenges to pedestrian facilities and evacuation management. In the event of a public safety incident such as a fire, public safety facilities and evacuation capabilities have a decisive impact on public safety. Improving evacuation efficiency and conducting real-time evacuation simulations have become urgent challenges.
[0003] Computer simulation technology, known for its safety, repeatability, and adaptability to changing environments, has been increasingly applied to the scientific research of evacuation theory in recent years. Computer simulation technology can easily obtain evacuation parameters for various crowd sizes and environments, facilitating the development and implementation of appropriate evacuation plans. Generally speaking, dynamic models of evacuation can be categorized into two simple categories: continuous models and discrete models. Continuous models typically define the behavior of evacuees through functions. Common continuous models include social force models and fluid dynamics models. Discrete models discretize evacuation scenarios in time or space, allowing evacuation behavior to evolve within discrete scenarios. Representative discrete models include cellular automata and lattice gas models, with the cellular automaton model being the most representative.
[0004] Cellular Automata (CA), also known as unitary automata or cellular automata, is a discrete dynamical system in time and space. It was proposed by mathematician and computer scientist Von Neumann. The most basic concept in cellular automata is the cell. A cell is the smallest unit obtained by dividing the space according to certain rules in the cellular automata model. The important feature of a cell is that it has a finite number of states, and all cells evolve and update according to the same rules. Cells will affect adjacent cells, and cells in the entire discrete space will affect each other, eventually forming an overall evolutionary trend. The main differences between the cellular automata model and other discrete dynamical models are: (1) it does not have a clear and strict function or formula, but generates an evolutionary trend through updating rules; (2) the states of cells are finite, and the influence range of these states is also limited in time and space.
[0005] However, existing models are generally used for pre-planning analysis and risk assessment, as well as post-accident scenario reconstruction. These models are primarily used in simulations, but lack the ability to analyze the actual distribution of personnel and the disaster situation in real-time, generating evacuation strategies to assist management personnel. Existing models are unable to perform real-time evacuation simulations, making them of limited practical application. Summary of the Invention
[0006] In order to solve the technical problems mentioned in the above background technology, the present invention proposes a real-time crowd evacuation simulation method based on computer vision. Pedestrians are located using computer vision, and their positions are imported into a cellular automaton evacuation model. Evacuation simulation is performed according to the actual positions of pedestrians, which can provide scientific guidance for the design of building structures, management of dense crowds, and safe evacuation plans for emergencies.
[0007] In order to achieve the above technical objectives, the technical solution of the present invention is:
[0008] A real-time crowd evacuation simulation method based on computer vision includes the following steps:
[0009] S1, collect human images and create a human image dataset;
[0010] S2. Use the human image dataset created in step S1 to train the yolov3 human detection model;
[0011] S3, obtain the camera RTSP video stream, input the RTSP video stream into the yolov3 human detection model to identify humans and obtain pixel coordinates;
[0012] S4, performing three-dimensional spatial positioning through monocular machine vision to convert the human pixel coordinates obtained in step S3 into world coordinates;
[0013] S5. Extract the features of the evacuation scene and establish a two-dimensional cellular automaton evacuation model of the evacuation scene;
[0014] S6. Place the pedestrians into the grid of the two-dimensional cellular automaton evacuation model established in step S4 through world coordinates to perform real-time evacuation simulation.
[0015] The beneficial effects brought about by adopting the above technical solution are:
[0016] Compared to existing technologies, the method described in this invention is significantly more effective in locating pedestrians through computer vision and performing real-time evacuation simulation using a cellular automaton model. Previous research methods mostly randomly distributed pedestrians within the evacuation space. This method, by using computer vision to locate pedestrians and perform evacuation simulations, effectively addresses the limitation of previous studies that were unable to simulate evacuations based on actual pedestrian distribution. Furthermore, this method makes crowd evacuation computer simulations more realistic, providing an important basis for safe crowd evacuation drills. It can also monitor building evacuation performance, optimize the actual evacuation process, and improve evacuation efficiency.
[0017] The present invention can be applied to emergency evacuation in various crowded public places (such as subways, large supermarkets, etc.), provide risk assessment for building acceptance, objectively evaluate the personnel carrying capacity of the building site and the rationality of the evacuation channel setting, and provide scientific guidance for the design of building structures, dense crowd management, and emergency safety evacuation plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of the crowd evacuation simulation method based on computer vision of the present invention;
[0019] Figure 2 The original image input to the yolov3 algorithm;
[0020] Figure 3 The image exported by the yolov3 algorithm;
[0021] Figure 4 Schematic diagram of image coordinates and pixel coordinates;
[0022] Figure 5 This is a schematic diagram of the camera pinhole model;
[0023] Figure 6 Schematic diagram of the world coordinate system and camera coordinate system;
[0024] Figure 7 This is a schematic diagram of the evacuation scenario;
[0025] Figure 8 Schematic diagram of grid movement potential energy in evacuation scenario;
[0026] Figure 9 Provide a flow chart for evacuation simulation;
[0027] Figure 10 It is the start map of evacuation;
[0028] Figure 11 Take a screenshot 2 seconds after the evacuation begins;
[0029] Figure 12 Take a screenshot 4 seconds after the evacuation begins;
[0030] Figure 13 This is the end of evacuation diagram. DETAILED DESCRIPTION
[0031] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.
[0032] The present invention discloses a real-time crowd evacuation simulation method based on computer vision. Figure 1 The flowchart of the crowd evacuation simulation method based on computer vision of the present invention is as follows. The method is executed by a computer system and includes the following specific steps:
[0033] (1) Collect human images and create a human dataset;
[0034] (2) Collect human data sets to train the yolov3 human detection model;
[0035] (3) Obtain the camera RTSP video stream, input the RTSP video stream into the yolov3 human detection model to identify humans and obtain pixel coordinates;
[0036] (4) 3D spatial positioning is performed using monocular machine vision to convert human pixel coordinates into world coordinates;
[0037] (5) Extract the characteristics of the evacuation scene and establish a two-dimensional cellular automaton evacuation model of the evacuation scene;
[0038] (6) Place humans into the grid of the cellular automaton evacuation model through world coordinates and perform real-time evacuation simulation;
[0039] In step (1), human images are collected to create a human dataset. The collection methods include network acquisition, on-site photography, etc. After obtaining a large number of human images, data enhancement is performed on the images. Data enhancement methods include image flipping, image rotation, and mirroring. The human images are then annotated using rectangular boxes in an image annotation tool. The center, width, and height of each rectangular box are obtained. This rectangular box is also called the correct annotated box. Finally, the human dataset is divided into a training set and a test set in an 8:2 ratio.
[0040] The human data set used in step (2) is used to train the yolov3 human detection model. The main steps of the training include:
[0041] Reshape the resolution of each image in the human dataset to 416×416;
[0042] The yolov3 feature extraction network is used to extract features from the image, and three feature images of different sizes are obtained, namely 13×13×255, 26×26×255, and 52×52×255;
[0043] Using regression to predict several candidate target bounding boxes mainly includes the following steps:
[0044] 1) Use k-means clustering algorithm to set the preset bounding box (c x ,c y ,p w ,p h ). The c x ,c y is the center coordinate of the preset bounding box on the feature map, p w ,p h The width and height of the preset bounding box on the feature map;
[0045] 2) Calculate the predicted bounding box center offset t x ,t y and aspect ratio t w ,t h
[0046] 3) Update the predicted bounding box (b x ,b y ,b w ,b h ), the calculation formula is as follows:
[0047]
[0048] Where σ represents the Sigmoid function, which is used to scale the offset to between 0 and 1. x ,b y ) is the center coordinate of the predicted bounding box, (b w ,b h ) is the width and height of the predicted target bounding box, t x ,t y represents the center offset of the predicted bounding box, t w ,t h Indicates the aspect ratio.
[0049] 4) The learning process of the yolov3 algorithm is the process of continuously reducing the error between the predicted bounding box and the correctly labeled box. Its loss function consists of three parts: positioning loss, confidence loss, and classification loss.
[0050] Positioning loss includes center coordinate loss and width and height loss. The specific formula is as follows:
[0051]
[0052] Where λ coord is the weight coefficient of positioning loss, N represents the feature map scale (can be 13, 26, 52), t x ,t yrepresents the center offset of the predicted bounding box, t w , t h Indicates the aspect ratio, t xg , t yg , t wg , t hg Represent the center coordinates, width and height of the correct annotation box respectively. Indicates whether the jth bounding box in the i-th grid cell is responsible for detecting the target. If so, Calculate the positioning loss. If it does not exist, Skip this bounding box.
[0053] The confidence loss calculation is described using cross entropy. Unlike the positioning loss calculation, the confidence loss calculation needs to calculate the confidence loss regardless of whether the bounding box is responsible for the target prediction, as shown in the following formula
[0054]
[0055] The confidence loss calculation formula is divided into two parts: target and non-target. In particular, λ is introduced in the non-target part. noobj The coefficient reduces the calculation weight in the case of no target, usually defaults to 0.5. ij represents the prediction confidence, and N represents the feature map scale.
[0056] When the jth prior box in the i-th grid cell is responsible for predicting the target, the loss of the predicted classification at this time needs to be calculated as shown in the following formula. is the true category probability, p ij (c) is the probability of the predicted category, and N represents the feature scale.
[0057]
[0058] The final loss function of yolov3 can be obtained by summing these three loss functions, as shown below.
[0059] Loss=Loss coord +Loss confidence +Loss class (5)
[0060] Step (3) of the method is to obtain the camera RTSP video stream, input the RTSP video stream into the yolov3 human detection model to identify humans and obtain pixel coordinates. RTSP video stream, the full name of which is Real Time Streaming Protocol (RTSP), RFC2326 (Chinese version), is an application layer protocol in the TCP / IP protocol system, and is an IETF RFC standard submitted by Columbia University, Netscape, and RealNetworks. This protocol defines how one-to-many applications can effectively transmit multimedia data over an IP network. The trained yolov3 human detection model can recognize video frames of the RTSP video stream in real time, recognize humans in the current video frame, and mark them out using a predicted bounding box, and determine the pixel coordinates of humans by the center point of the predicted bounding box. The specific effects are as follows: Figure 2 、 3 As shown, Figure 2 is the original image, Figure 3 The image exported after the yolov3 human detection model is recognized, and you can see that each person is drawn with a predicted bounding box. The center point of each person's predicted bounding box is taken as the pixel coordinate of the person. The specific pixel coordinates are shown in the following table.
[0061] Table 1 Pixel coordinate correspondence table
[0062]
[0063] The three-dimensional spatial positioning by monocular machine vision described in step (4) converts human pixel coordinates into world coordinates, which means that pixel coordinates can be converted into world coordinates through the camera pinhole model. The specific process is as follows:
[0064] There are four coordinate systems when an image is formed in a camera: the image coordinate system, the pixel coordinate system, the camera coordinate system, and the world coordinate system.
[0065] Image coordinate system: The image coordinate system can describe the real physical distance of the image itself. Its coordinate plane is located on the plane where the camera photosensitive chip is located. The coordinate origin O i It is the corner point between the camera optical axis and the photosensitive chip. The x-axis is horizontal and parallel to the edge of the image, and the y-axis is perpendicular to the x-axis and points downward.
[0066] Pixel coordinate system: An image is composed of multiple pixels. The pixel coordinate system is a reference system established to describe the relationship between pixels in an image. It is in the same plane as the image coordinate system. The x-axis and y-axis of the pixel coordinate system are parallel to the x-axis and y-axis of the image coordinate system, and have the same direction. The origin of the coordinate system is O. p Located in the upper left corner of the image, that is, above the image coordinate system, the relationship between the two coordinate systems is as follows Figure 4 shown.
[0067] according to Figure 4 , the transformation relationship between the two coordinate systems is as follows.
[0068]
[0069] Where (u0, v0) is the coordinate of the origin of the image coordinate system in the pixel coordinate system, the width of a unit pixel is dx, the length is dy, and (x, y) represents the coordinate of the transformed point in the image coordinate system. The above formula is converted into a matrix form as shown in the following formula:
[0070]
[0071] Camera coordinate system: The camera imaging model can be approximately described by the pinhole model. A point P in space is projected through the pinhole to the image coordinate system to form a corresponding point P'. The relationship between the points can be expressed as Figure 5 The camera coordinate system takes the optical center of the camera as the coordinate origin, the z-axis is the optical axis of the camera, and its positive direction is the direction from the photosensitive chip to the lens. Let P c (x c ,y c ,z c ) is a point in the camera coordinate system, and the corresponding point in the image coordinate system is P(x,y). The point conversion relationship between the two coordinate systems is as follows.
[0072]
[0073] Where f is the focal length of the camera. Convert the above formula into matrix form as follows:
[0074]
[0075] Substituting Formula 9 into Formula 7, we finally get the relationship matrix between the camera coordinate system and the pixel coordinate system, as shown below:
[0076]
[0077] in K is called the intrinsic parameter matrix of the camera.
[0078] World coordinate system: The world coordinate system is a reference coordinate system used to describe the positions of cameras and targets in the real world, which can be freely determined by the user. Since the three-dimensional coordinates in the camera coordinate system are difficult to measure directly, it is generally necessary to use the world coordinate system for indirect measurement. Figure 6 It is the conversion relationship between the world coordinate system and the camera coordinate system.
[0079] The transformation matrix between the world coordinate system and the camera coordinate system is expressed as follows:
[0080]
[0081] Among them, R 3×3 is the rotation matrix, t 3×1 is the translation matrix, (x w ,y w ,z w ) represents the coordinates of the transformed point in the world coordinate system, (x c ,y c ,z c ) represents the coordinates of the transformed point in the camera coordinate system. Combining Formula 10 and Formula 11, we can finally get the transformation relationship between the pixel coordinate system and the world coordinate system. The formula is as follows:
[0082]
[0083] Where (u, v) represents the coordinates of the transformed point in the pixel coordinate system, (x w ,y w ,z w ) represents the coordinates of the transformed point in the world coordinate system, K[R|t] represents the product of the camera's intrinsic parameter matrix and extrinsic parameter matrix, z c Indicates the depth of field of the pixel from the camera. The camera's intrinsic and extrinsic matrix are obtained through Zhang Zhengyou calibration method. Zhang Zhengyou calibration method is a camera calibration based on a 2D plane target. We take multiple pictures of the calibration plate, and then through the one-to-one correspondence between multiple actual points (world coordinates) and points on the picture (pixel coordinates), we can calculate the camera's intrinsic and extrinsic matrix. Figure 2 Taking the scene as an example, with the upper left corner of the scene as the origin, the positioning results of the 13 people in the picture are shown in the following table.
[0084] Table 2 World coordinate correspondence table
[0085]
[0086] Step (5) extracts the features of the evacuation scene, establishes a two-dimensional cellular automaton evacuation model of the evacuation scene, and extracts scene features including the geometric shape of the evacuation scene, the location and width of the evacuation exit, and the location and size of the obstacles. The cellular automaton evacuation model divides the site into multiple grids. The local moving potential energy of the grids adjacent to the building exit is defined as 1, and the moving potential energy of the grids adjacent to these grids increases. This is repeated until all grids in the evacuation space are assigned corresponding potential energy values, and the potential energy of all obstacles is infinite (inf). The algorithm used for assigning potential is the breadth-first search algorithm. Figure 2 The evacuation scene is 10m×17m in size, with two 2m exits and 14 2m×1m and 7 4m×1m obstacles. Figure 7As shown in the figure, the green line represents the exit, the purple rectangle represents the obstacle, and the blue dotted line represents the wall. The grid movement potential of the evacuation scene graph is as follows Figure 8 shown.
[0087] The process of placing humans into the grid of the cellular automaton evacuation model according to the world coordinates and performing real-time evacuation simulation in step (6) is as follows: humans are placed into the grid of the corresponding cellular automaton evacuation model according to the world coordinates. Humans will directly calculate the shortest evacuation path based on the distance from the initial position to the evacuation exit. When there are no obstacles on the line between the initial position of the evacuees and the evacuation exit, the evacuees will directly select the shortest evacuation path based on the distance from the initial position to the evacuation exit; when there are obstacles on the line, the evacuees will move from the grid with large moving potential energy to the grid with small moving potential energy until they move to the exit. The specific flow chart is as follows: Figure 9 As shown. Humans can choose eight movement directions: up, down, left, right, upper left, lower left, upper right, and lower right. The movement speed is calculated based on the crowd density in the grid. The corresponding calculation formula is as follows:
[0088]
[0089] Where v(i) represents the moving speed of person i, in m / s, and D(i) represents the crowd density of the grid where person i is located, in persons / m 2 When all people have moved to the safe exit, the evacuation is complete. Figure 10 , as shown in 11, 12, and 13.
[0090] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal translation scripting language JavaScript, etc.
[0091] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0094] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0095] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A real-time crowd evacuation simulation method based on computer vision, characterized in that: The following steps are involved: S1, collect human images and create a human image dataset; S2. Use the human image dataset created in step S1 to train the yolov3 human detection model; S3, obtain the camera RTSP video stream, input the RTSP video stream into the yolov3 human detection model to identify humans and obtain pixel coordinates; S4, performing three-dimensional spatial positioning through monocular machine vision to convert the human pixel coordinates obtained in step S3 into world coordinates; S5. Extract the features of the evacuation scene and establish a two-dimensional cellular automaton evacuation model of the evacuation scene; Step S5 specifically comprises: extracting features of the evacuation scene and establishing a two-dimensional cellular automaton evacuation model of the evacuation scene, wherein the extracted scene features include the geometric shape of the evacuation scene, the location and width of the evacuation exit, and the location and size of obstacles. The cellular automaton evacuation model divides the site into multiple grids, and the local movement potential energy of the grids adjacent to the building exit is defined as 1. The movement potential energy of the grids adjacent to these grids increases, and this process is repeated until all grids in the evacuation space are assigned corresponding potential energy values, and the potential energy of all obstacles is infinite (inf). The algorithm used for assigning potential is a breadth-first search algorithm. S6. Place the pedestrians into the grid of the two-dimensional cellular automaton evacuation model established in step S4 through world coordinates to perform real-time evacuation simulation; Said step S6 specifically refers to: placing a human into the grid of the cellular automaton evacuation model according to the world coordinates, and performing a real-time evacuation simulation process as follows: placing the human into the grid of the corresponding cellular automaton evacuation model according to the world coordinates, the human will directly calculate the shortest evacuation path according to the distance from the initial position to the evacuation exit. When there is no obstacle on the line between the evacuee's initial position and the evacuation exit, the evacuee will directly select the shortest evacuation path according to the distance from the initial position to the evacuation exit; when there is an obstacle on the line, the evacuee will move from the grid with large potential energy to the grid with small potential energy until reaching the exit; the human can choose eight moving directions: up, down, left, right, upper left, lower left, upper right, and lower right. The moving speed is calculated according to the crowd density in the grid, and the corresponding calculation formula is as follows: Where v(i) represents the moving speed of person i, in m / s, and D(i) represents the crowd density of the grid where person i is located, in person / m 2 , the evacuation ends when everyone has moved to the safe exit.
2. The method for simulating real-time crowd evacuation based on computer vision according to claim 1, characterized in that: Step S1 specifically includes: collecting human images through the Internet or on-site shooting, and performing data enhancement on the collected images, including image flipping, image rotation and mirroring; then using the rectangular box of the image annotation tool to annotate the human images, and the rectangular box is defined as the correct annotation box; obtaining the center, width and height corresponding to each rectangular box, and finally dividing the human image dataset into a training set and a test set in a ratio of 8:
2.
3. The method for simulating real-time crowd evacuation based on computer vision according to claim 1, characterized in that: Step S2 specifically refers to: S21, reshape the resolution of each image in the human image dataset to 416×416; S22, use the yolov3 feature extraction network to extract features from the image, and obtain three feature images of different sizes: 13×13×255, 26×26×255, and 52×52×255; S23, use k-means clustering algorithm to set the preset bounding box (c x ,c y ,p w ,p h ), where c x and c y is the center coordinate of the preset bounding box on the feature map, p w and p h The width and height of the preset bounding box on the feature map; S24. Calculate the predicted bounding box center offset t x ,t y and aspect ratio t w ,t h ; S25, update the predicted bounding box (b x ,b y ,b w ,b h ), the calculation formula is as follows: Where σ represents the Sigmoid function, which is used to scale the offset to between 0 and 1. x ,b y ) is the center coordinate of the predicted bounding box, (b w ,b h ) is the width and height of the predicted target bounding box; t x and t y represents the center offset of the predicted bounding box, t w and t h Indicates the aspect ratio; The learning process of the S26 and Yolov3 algorithms is the process of continuously reducing the error between the predicted bounding box and the correct labeled box. Its loss function consists of three parts: positioning loss, confidence loss, and classification loss. The formula is expressed as follows: Where λ coord is the weight coefficient of positioning loss, N represents the feature map scale, t x and t y represents the center offset of the predicted bounding box, t w and t h Indicates the aspect ratio, t xg , t yg , t wg and t hg Represent the center coordinates, width and height of the correct annotation box respectively; Indicates whether the jth bounding box in the i-th grid cell is responsible for detecting the target. If so, Calculate the positioning loss. If it does not exist, Skip this bounding box; The confidence loss calculation is described using cross entropy, and the formula is as follows: The confidence loss calculation formula is divided into two parts: target and non-target. In particular, λ is introduced in the non-target part. noobj The coefficient reduces the calculation weight in the case of no target, and the weight value is 0.5; C ij Represents the prediction confidence; N represents the feature map scale; When the jth prior box in the i-th grid cell is responsible for predicting the target, the loss of the predicted classification at this time is calculated as shown in the following formula: Where, is the true category probability, p ij (c) is the probability of the predicted category; The final loss function of yolov3 is obtained by summing the positioning loss, confidence loss and classification loss functions. The formula is as follows: Loss=Loss coord +Loss confidence +Loss class (6) Where Loss is the final loss function of yolov3.
4. The method for simulating real-time crowd evacuation based on computer vision according to claim 1, characterized in that: Step S4 specifically refers to: converting pixel coordinates into world coordinates through the camera pinhole model. The specific formula is as follows: Where (u, v) represents the coordinates of the transformed point in the pixel coordinate system, (x w ,y w ,z w ) represents the coordinates of the transformed point in the world coordinate system, K[R|t] represents the product of the camera's intrinsic parameter matrix and extrinsic parameter matrix, z c Represents the depth of field of the pixel from the camera; the camera's intrinsic parameter matrix and extrinsic parameter matrix are obtained through Zhang Zhengyou calibration method.
Citation Information
Patent Citations
Indoor evacuation simulating optimization method based on potential energy driving cellular ant colony algorithm
CN104361178A
Dynamic acquisition terminal for behavior statistic information of people, evacuation system and method
WO2016073292A1