Intelligent camera arrangement method for digital twinning construction of building

The MAPPO algorithm optimizes the layout of surveillance cameras, which solves the problem of low camera layout efficiency in the construction field, significantly improves coverage, and provides an intelligent layout solution for the construction of digital twins of buildings.

CN118965638AActive Publication Date: 2024-11-15BEIJING UNIV OF CIVIL ENG & ARCHITECTURE

Patent Information

Application Number
CN202410934420.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-15
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

In the field of architecture, the effective arrangement of surveillance cameras faces challenges, including how to maximize coverage under a limited budget, meet the monitoring needs of complex scenarios, and adapt to changing environmental conditions. It is difficult for traditional methods to determine the optimal layout of the camera.

Method used

The MAPPO algorithm is used to optimize the layout of the surveillance camera. By obtaining the obstacle area and monitoring area of ​​the scene to be arranged, the camera model is constructed and the state space, action space and reward functions of the agent are designed, and iteratively updated using the Actor and Critic networks to obtain The final camera layout.

Benefits of technology

It significantly improves the coverage of surveillance cameras, provides new ideas for intelligent camera layout for building digital twins, optimizes the specific position and angle of the camera, and improves the monitoring coverage effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965638A_ABST
    Figure CN118965638A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of digital twinning of buildings, in particular to an intelligent camera arrangement method for digital twinning construction of buildings, which comprises the following steps: acquiring a scene to be arranged; preprocessing the scene to be arranged to obtain an obstacle area and a monitorable area; a preliminary arrangement scheme of the camera is obtained through the obstacle area and the monitorable area, the preliminary arrangement scheme is optimized based on an MAPPO algorithm, and a final arrangement scheme is obtained; and completing camera arrangement in the scene to be arranged based on the final arrangement scheme. According to the method, the specific position and angle of the camera are analyzed and adjusted based on the MAPPO algorithm, the layout of the monitoring camera is optimized, and the coverage rate is remarkably increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of building digital twins, and in particular to a camera intelligent arrangement method for building digital twins. Background Art

[0002] Digital twin (DT) construction integrates the new generation of information technology and digital construction technology, realizes the need for interactive integration of digital models and physical construction, and is an important driving force for promoting the intelligentization of the construction industry. DT integrates other emerging technologies such as machine learning, artificial intelligence (AI), and data analysis to help make smarter decisions in the operation and maintenance of buildings and other facilities. Previous research in the construction field has established the ability of DT to enhance the management of buildings and other built environment facilities. Building digital twin (BDT) has become a key technology to improve the efficiency of building operations and the quality of management.

[0003] Surveillance cameras are an indispensable component for realizing building intelligence. They not only provide the necessary visual data for security monitoring, but also provide the basis for building digital twins of building interiors, promoting the transformation of BIM to BDT. Nevertheless, the effective deployment of surveillance cameras faces multiple challenges, including how to maximize coverage under a limited budget, meet the monitoring needs of complex scenes, and adapt to changing environmental conditions. The surveillance camera deployment problem is essentially an NP-hard combinatorial optimization problem involving numerous constraints and requirements, such as the diversity of monitoring tasks, the physical and technical limitations of cameras, and the structural characteristics of specific scene areas. These factors make it extremely difficult to use traditional simple enumeration or search techniques to determine the optimal camera deployment solution. How to deploy surveillance cameras in appropriate locations to obtain the maximum surveillance coverage area under the most economical conditions is a challenging problem. Summary of the invention

[0004] The purpose of the present invention is to provide a camera intelligent layout method for building digital twin construction, and to optimize the layout of surveillance cameras in the building interior through the MAPPO algorithm.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] The camera intelligent arrangement method for building digital twins includes:

[0007] Get the scene to be arranged;

[0008] Preprocessing the scene to be arranged to obtain obstacle areas and monitorable areas;

[0009] Obtaining a preliminary arrangement plan of cameras through the obstacle area and the monitorable area, optimizing the preliminary arrangement plan based on the MAPPO algorithm, and obtaining a final arrangement plan;

[0010] The camera arrangement in the scene to be arranged is completed based on the final arrangement solution.

[0011] Optionally, preprocessing the scene to be arranged includes:

[0012] Preset a grid scale and a threshold, use the grid to divide the scene to be arranged, and obtain a grid map;

[0013] The grids where the obstacles are located in the grid map are marked and encoded to obtain the obstacle area and the monitorable area.

[0014] Optionally, the obstacle area is calculated as follows:

[0015]

[0016] Among them, Occ i,j is the occupancy rate of the obstacle in each grid (i, j) of the grid map, S B (i, j) is the occupancy of obstacles in each grid, S i,j is the size of each grid, Th is the preset proportion of obstacles in each grid, 0 means that the grid is considered as an obstacle-free area, and 1 means that the grid is considered as an obstacle area.

[0017] Optionally, obtaining a preliminary arrangement plan of cameras through the obstacle area and the monitorable area includes:

[0018] Build a camera model;

[0019] A preliminary arrangement of cameras is performed in the monitorable area based on the camera model to obtain the preliminary arrangement plan, wherein the preliminary arrangement plan includes the arrangement positions, angles, and quantities of the cameras.

[0020] Optionally, the camera model is:

[0021]

[0022] Among them, Z C are the coordinate values ​​of the Z axis of each boundary point in the camera's visible range in the camera coordinate system. The coordinates of the boundary points in the camera's visible range are (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. A is the camera's intrinsic parameter matrix. M is the camera's extrinsic parameter matrix, which is defined by matrices R and T. R is the camera's rotation matrix, and T is the camera's translation matrix. u and v are the length and width of the camera's internal image sensor, respectively.

[0023] Optionally, optimizing the preliminary layout scheme based on the MAPPO algorithm to obtain the final layout scheme includes:

[0024] Taking the camera as an intelligent agent, designing the state space, action space, and reward function of the intelligent agent;

[0025] In the Actor network, define the policy network and policy network objective function of the agent;

[0026] In the Critic network, the value network and the value network objective function of the agent are defined;

[0027] Under the constraints of the policy network, value network, state space, and action space, the state and action of the agent are iteratively updated with the reward function, policy network objective function, and value network objective function as optimization targets to obtain the final deployment plan.

[0028] Optionally, the state space is:

[0029] S=[s1,s2,s3,…,s i ]

[0030] Where S is the state space, s i is the state of agent i;

[0031] The action space includes: movement, rotation and quantity adjustment;

[0032] The reward function is:

[0033] R=∑(R NewCov +R ove +R bli +R All_cov )+R edge +R num

[0034] Among them, R is the reward function, R NewCov To add coverage rewards, R All_cov To complete all coverage rewards, R ove is the field of view overlap reward, R bli is the blind spot reward, R edge Grid map area border reward, R num Added bonus for number of cameras.

[0035] Optionally, the policy network is The objective function of the strategy network is:

[0036]

[0037] Among them, a is the action taken by the agent in state s, θ is the parameter of the policy network, For expectations, is the advantage function, indicating taking action a t In status t The expected return gain relative to the average, clip(r t (θ), 1-ε, 1+ε) is the strategy update amplitude, ε is a constant; is the strategy ratio, θ old is the previous parameter of the policy network.

[0038] Optionally, the value network is The value network objective function is:

[0039]

[0040] Among them, V t target is the target value function.

[0041] The beneficial effects of the present invention are:

[0042] The present invention analyzes and adjusts the specific position and angle of the camera based on the MAPPO algorithm, optimizes the layout of surveillance cameras, significantly improves the coverage rate, and provides a new idea for the intelligent arrangement of cameras for the research on building BDT through machine vision. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 This is a flow chart of a camera intelligent arrangement method for building digital twins according to an embodiment of the present invention;

[0045] Figure 2 A diagram of a common camera installation method according to an embodiment of the present invention;

[0046] Figure 3 The coverage of the field of view of the surveillance camera in the embodiment of the present invention in the grid map;

[0047] Figure 4 The situation of obstacles in the camera field of view in the grid map of the embodiment of the present invention;

[0048] Figure 5This is a situation where the monitoring coverage areas of two cameras overlap in the grid map of an embodiment of the present invention;

[0049] Figure 6 The second floor plan of the D-building of a certain university in an embodiment of the present invention;

[0050] Figure 7 The position, orientation and coverage of the original surveillance camera on the second floor of the D college building of a certain university in an embodiment of the present invention;

[0051] Figure 8 The error variation trend of the monitoring camera deployment network training process using the MAPPO algorithm according to an embodiment of the present invention;

[0052] Fig. 9 The changing trend of the average return reward per round in the process of training the surveillance camera deployment network using the MAPPO algorithm in an embodiment of the present invention;

[0053] Fig.10 This is the coverage of the camera in the grid map after optimization according to the embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] This embodiment provides a camera intelligent arrangement method for building digital twins, including:

[0057] Get the scene to be arranged;

[0058] Preprocessing the scene to be arranged to obtain obstacle areas and monitorable areas;

[0059] Obtaining a preliminary arrangement plan of cameras through the obstacle area and the monitorable area, optimizing the preliminary arrangement plan based on the MAPPO algorithm, and obtaining a final arrangement plan;

[0060] The camera arrangement in the scene to be arranged is completed based on the final arrangement solution.

[0061] Further, preprocessing the scene to be arranged includes:

[0062] Preset a grid scale and a threshold, use the grid to divide the scene to be arranged, and obtain a grid map;

[0063] The grids where the obstacles are located in the grid map are marked and encoded to obtain the obstacle area and the monitorable area.

[0064] Specifically, the calculation method of the obstacle area is:

[0065]

[0066] Among them, Occ i,j is the occupancy rate of the obstacle in each grid (i, j) of the grid map, S B (i, j) is the occupancy of obstacles in each grid, S i,j is the size of each grid, Th is the preset proportion of obstacles in each grid, 0 means that the grid is considered as an obstacle-free area, and 1 means that the grid is considered as an obstacle area.

[0067] Furthermore, obtaining a preliminary arrangement plan of cameras through the obstacle area and the monitorable area includes:

[0068] Build a camera model;

[0069] A preliminary arrangement of cameras is performed in the monitorable area based on the camera model to obtain the preliminary arrangement plan, wherein the preliminary arrangement plan includes camera arrangement positions, angles, and quantities.

[0070] Specifically, the camera model is:

[0071]

[0072] Among them, Z C are the coordinate values ​​of the Z axis of each boundary point in the camera's visible range in the camera coordinate system. The coordinates of the boundary points in the camera's visible range are (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. A is the camera's intrinsic parameter matrix. M is the camera's extrinsic parameter matrix, which is defined by matrices R and T. R is the camera's rotation matrix, and T is the camera's translation matrix. u and v are the length and width of the camera's internal image sensor, respectively.

[0073] Further, the preliminary layout scheme is optimized based on the MAPPO algorithm to obtain the final layout scheme, including:

[0074] Taking the camera as an intelligent agent, designing the state space, action space, and reward function of the intelligent agent;

[0075] In the Actor network, define the policy network and policy network objective function of the agent;

[0076] In the Critic network, the value network and the value network objective function of the agent are defined;

[0077] Under the constraints of the policy network, value network, state space, and action space, the state and action of the agent are iteratively updated with the reward function, policy network objective function, and value network objective function as optimization targets to obtain the final deployment plan.

[0078] Specifically, the state space is:

[0079] S=[s1,s2,s3,…,s i ]

[0080] Where S is the state space, s i is the state of agent i;

[0081] The action space includes: movement, rotation and quantity adjustment;

[0082] The reward function is:

[0083] R=∑(R NewCov +R ove +R bli +R All_cov )+R edge +R num

[0084] Among them, R is the reward function, R NewCov To add coverage rewards, R All_cov To complete all coverage rewards, R ove is the field of view overlap reward, R bli is the blind spot reward, R edge Grid map area border reward, R num Added bonus for number of cameras.

[0085] The policy network is The objective function of the strategy network is:

[0086]

[0087] Where a is the action taken by the agent in state s, θ is the parameter of the policy network, For expectations, is the advantage function, indicating taking action a t In status t The expected return gain relative to the average, clip(r t (θ), 1-ε, 1+ε) is the strategy update amplitude, ε is a constant; is the strategy ratio, θold is the previous parameter of the policy network.

[0088] The value network is The value network objective function is:

[0089]

[0090] Among them, V t target is the target value function.

[0091] Combine the following Figure 1-Figure 5 The camera intelligent arrangement method for building digital twins provided in this embodiment is described in detail, and specifically includes the following steps:

[0092] Step 1: Build a monitoring model;

[0093] First, we build a surveillance camera model. For common cameras, the installation method is as follows: Figure 2 As shown in the figure, the length and width of the image sensor inside the camera are u and v respectively, and the focal length of the camera is f. The external parameters of the camera are represented by R and T, which define the real position of the camera. R is the rotation matrix of the camera, which is determined by the rotation angle of the camera in the real world, and is respectively The angles θ and ψ correspond to the camera's yaw, pitch, and roll angles.

[0094]

[0095]

[0096]

[0097] The camera rotation matrix is ​​R = R z (φ)·R y (θ)·R x (ψ).

[0098] This embodiment only builds digital twins for objects located on the ground, so the visual range of the surveillance camera must be located on the ground, that is, for any surveillance camera, its pitch angle θ is 90 degrees. w ,Y w ,Z w ), the conversion relationship between the position coordinates and the coordinates on the surveillance camera pixel plane is as follows:

[0099]

[0100] Plane P is the imaging plane of the camera, and plane ABCD is the projection of the surveillance camera imaging plane on the ground in the real world. This area is the field of view or visible range of the surveillance camera. In other words, when object Q can be captured by the surveillance camera, its position satisfies Q∈ABCD. The coordinates of the boundary points of the camera's visible range in the figure are A(x1,y1), B(x2,y2), C(x3,y3), and D(x4,y4), respectively, satisfying the following formula:

[0101]

[0102] Right now:

[0103]

[0104] Among them, Z C are the coordinate values ​​of the Z axis of each boundary point in the camera coordinate system. Matrix A is the intrinsic parameter matrix of the surveillance camera, which is determined by the camera's own parameters. M is the extrinsic parameter matrix of the camera, which is defined by matrices R and T. The R matrix is ​​a 3×3 matrix, and the T matrix is ​​a 3×1 matrix, which represent the rotation and translation matrices of the camera, respectively. They are the configuration of the surveillance camera and determine the position of the camera in the physical world.

[0105] Step 2: Preprocessing of the area to be arranged;

[0106] Before building the digital twin of the indoor area, preprocessing is required to establish the regional model of the surveillance cameras to be deployed. To improve the computational efficiency, rasterization is used to simplify the complex indoor environment and divide the area into independent grids of fixed size. The coverage requirements of the surveillance cameras are determined by analyzing the obstacles of each grid.

[0107] The grid is used to divide the indoor scene space of the building, and the grid is divided into two situations: idle area and obstacle area with different colors with large contrast. At the same time, the divided grid is encoded, and the grid map model is constructed to pre-process the area where the surveillance camera is to be deployed. The obstacle area is the part of the obstacles piled in the indoor scene that are displayed in the grid map after expansion or corrosion. The black grid indicates that there are obstacles in the area, and the white grid indicates that the area is not occupied by objects.

[0108] In the rasterization processing of indoor scenes, it is crucial to choose the appropriate grid scale and obstacle ratio threshold. If the grid scale is too small, although the scene fitting degree is high, it will cause too many grids, thus consuming a lot of computing resources. On the contrary, if the grid scale is too large, the fitting result will be too rough. By setting a suitable obstacle ratio threshold, the obstacle area and the non-obstacle area can be accurately distinguished. Different threshold settings will also affect the final display of the grid map. Therefore, when constructing a digital twin of a building and performing area preprocessing of surveillance cameras, it is key to reasonably set the grid scale and obstacle threshold, which will directly affect the practicality and efficiency of the grid map.

[0109] Assuming that the area is L×H and the scale of the grid is set to S, the number of grids obtained after processing is NumX×NumY, that is:

[0110]

[0111] The occupancy rate of obstacle B in each grid (i, j) of the regional grid map is Occ i,j , S B (i, j) is the occupancy of obstacles in each grid, S i,j For each grid size:

[0112]

[0113] Assuming that the proportion of obstacles in the grid is Th, each grid is encoded to represent the grid situation, 0 means that the grid is considered as an obstacle-free area, and 1 means that the grid is considered as an obstacle-existing area.

[0114] The grid scale and obstacle threshold are determined by the results of rasterization under different scales and threshold settings. First, the impact of scale size on the grid map is studied. For the convenience of statistics, the threshold Th is temporarily set to a larger value, Th = 0.1. Table 1 shows the total number of grids (Count_Grid), the number of black grids (Dark_Grid), the number of white grids (Pale_Grid), and the proportion of black grids in the total number of grids (Ratio) under different scales S. Table 2 shows the number of grids, the total number of grids and the proportion under different thresholds Th.

[0115] Table 1

[0116]

[0117]

[0118] Table 2

[0119]

[0120] According to the data analysis in Table 1, as the scale S increases, the proportion of black grids begins to increase. When this proportion is stable, the grid map better reflects the real scene. Considering the computational efficiency and cost, the larger scale S = 60 when the proportion of black grids is stable is selected as the most appropriate grid scale.

[0121] Similarly, by comparing different thresholds Th at the same scale S=60 in Table 2, it is found that when the threshold Th is small, the number of black grids increases and the proportion increases. When the threshold is greater than 0.55, this proportion does not change much, so this embodiment selects Th=0.55 as the optimal threshold for constructing a grid map to reflect obstacles in real scenes.

[0122] Step 3: Method for representing the coverage area of ​​surveillance cameras;

[0123] The calculation of the camera's field of view coverage is crucial to the analysis results. For a point in the scene to be captured by the camera, the point must be imaged within the camera's field of view and there must be no obstacles blocking the path.

[0124] After rasterizing the indoor scene using the preprocessing model, a grid map is obtained, and the coverage area of ​​the camera is quantified using the area of ​​the independent grids. Figure 3 The coverage of the surveillance camera field of view in the grid map is shown, where K(X K ,Y K ) is the projection position of the surveillance camera Cam on the ground, Dir_1 and Dir_2 are the two intersection points of the main shooting direction and the field of view of the surveillance camera, θ is the viewing angle of the camera, and i is a point on the ground.

[0125] The distance between point i and Cam or any point in the area is represented by D, and the angle between point i and the camera projection point K and the point Dir in the main direction has the following relationship:

[0126]

[0127] If point i is within the camera's field of view, this relationship is expressed in binary form as follows: 1 means that the area is within the camera's field of view, and 0 means that it is not.

[0128]

[0129] This embodiment performs quantitative representation by analyzing the relationship between the obstacle boundary and the camera field of view and the angle between them. Figure 4 The grid map shows the situation of obstacles in the camera field of view, where e and f are the obstacle boundary points at the edge of the field of view, and i is a ground point that may be behind the obstacle. The angle between point i and the camera projection point K and the point Dir in the main direction is Ang i,K,Dir, the angles between point e, f, point K and point i are Ang e,K,i and Ang f,K,i Therefore, if there is an obstacle between point i and the camera in the region, the grid where point i is located satisfies the following relationship. 1 means that the area represented by this part of the grid is blocked by obstacles in the real world, and 0 means that it is not blocked.

[0130]

[0131] When deploying cameras, there may be a situation where the monitoring coverage areas of two cameras overlap, such as Figure 5 As shown, point i is located in the overlapped space of the two camera coverage areas. K1 ,Y K1 )、K_2(X K2 ,Y K2 ) is the projection position of the surveillance cameras Cam_1 and Cam_2 on the ground, Dir is any point in the main direction shot by each surveillance camera, and θ is the viewing angle of the camera.

[0132] In this case, the following method is used to express it:

[0133]

[0134] Step 4: Camera arrangement optimization based on MAPPO algorithm;

[0135] When deploying many surveillance cameras with multiple degrees of freedom in indoor scenes, it is more appropriate to use a high-dimensional multi-agent optimization algorithm. Compared with a single-agent optimization algorithm, a multi-agent system must not only cope with environmental changes, but also consider the impact of other agents' behaviors. When an agent makes decisions based on limited environmental information, it will change the state of the environment, which may invalidate old decisions and cause non-steady-state problems in training.

[0136] In multi-agent tasks, each agent makes decisions based on its local environment information. This model is defined as a decentralized partially observable Markov decision process (DEC-POMDP). In the framework, the DEC-POMDP model is defined as (S, A, O, R, P, n, γ). Among them, S represents the state of the environment, that is, the state space of the global environment. A represents the joint action space of all agents, and the actions of each agent are included in it, that is, A = (a 1 ,a 2 ,a 3 ,…,a n ). O represents the joint observation value of the agent, O n is the local observation of agent n in the global state s, that is, O = (o 1 ,o 2 ,o 3,…,o n ). R(s,A) is the reward function shared by all agents. P(s′|s,A) describes the probability that the state space of the global environment shifts from S to S′ after the agents perform a joint action A. n represents the number of agents in the environment. γ is the discount factor for the reward. The joint strategy of the agents is expressed as Π=(π 1 ,π 2 ,π 3 ,…,π n ), each agent tends to adopt the same strategy π under local observations θ (a i |o i ).

[0137] Step 4.1, design of state space action space and reward function;

[0138] In this embodiment, based on the actual installation requirements of the monitoring network, all monitoring cameras adopt uniform specifications and are adjusted to the optimal pitch angle to ensure consistent pitch angles. In addition, considering indoor construction and cost requirements, all cameras are installed at the same level. In this way, the field of view of each camera remains consistent without obstruction, and the position and orientation (yaw angle) of each camera are mainly considered during the optimization process.

[0139] State space S: In reinforcement learning, the design of the state space is crucial, and it affects the performance of the algorithm together with the reward function. In multi-agent optimization, the decision of each agent is affected by the joint actions of all agents. Therefore, the state space S should not only contain the state of each agent, but also include global environmental information so that the agent can make decisions to move or adjust the direction and promote collaborative optimization among agents. As shown in the following formula:

[0140] S=[s1,s2,s3,…,s i ]

[0141] For each agent (surveillance camera) i, its state s i At time t, it can be expressed as follows:

[0142]

[0143] in, represents the location coordinates of surveillance camera i on the regional grid map, It represents the rotation yaw angle of surveillance camera i, that is, the orientation of the camera, which determines the direction of the camera's field of view. Indicates the rotation angle of surveillance camera i Next, the grid area that the field of view can cover. Describes the situation where the surveillance areas of surveillance cameras overlap. It can be calculated by calculating the coverage vector of camera i The intersection of the coverage area with other cameras is obtained. Represents the blocked areas within the field of view of surveillance camera i.

[0144] Action Space A: Each surveillance camera can perform actions such as movement, rotation, and quantity adjustment. Movement includes staying in place (wait) or moving to an adjacent grid. Moving to an adjacent grid includes up (up), down (down), left (left), and right (right). The rotation action allows the camera to adjust the yaw angle clockwise (CW) or counterclockwise (CCW). The quantity action involves increasing or decreasing the number of surveillance cameras to meet optimization needs.

[0145] Reward function R: Each surveillance camera agent will have its own reward, which depends on the current state of each agent, the action currently being performed, and the state (s, a, s') at the next moment. In the scenario of this embodiment, the rewards for the agent include: New coverage reward R NewCov , complete all coverage rewards R All_cov , field of view overlap reward (penalty) R ove , Blind spot reward (penalty) R bli , Map area boundary reward (penalty) R edge , Reward (penalty) for increasing the number of surveillance cameras R num Specifically, the reward for the first coverage of a grid is +2, the penalty for overlapping fields of view caused by adding a camera is -1, the penalty for blind spots is -1, the penalty for camera crossing the boundary is -200, and the reward value increases by 80 when the key grid is covered by at least two cameras. These settings constitute the total reward function R:

[0146] R=∑(R NewCov +R ove +R bli +R All_cov )+R edge +R num

[0147] Step 4.2: Layout optimization based on MAPPO algorithm;

[0148] MAPPO is a multi-agent version of the PPO algorithm that enhances training stability by limiting the magnitude of each policy update. It keeps the ratio of new and old policies within an optimal range and avoids large jumps in the policy space. In the Actor network, for each agent i, its policy is defined as Where θ represents the parameters of the policy network, and a is the action taken by the agent in state s. In the Critic network, the joint observation (o1 ,o 2 ,o 3 ,…,o n ) and joint action (a 1 ,a 2 ,a 3 ,…,a n ) as input, the estimated value realizes the evaluation of the action and is fed back to the Actor network to affect the choice of the next action. MAPPO aims to optimize the following objective function:

[0149]

[0150] Among them, θ is the parameter of the policy network, For expectations, is the advantage function, indicating that taking action a t In status t The expected return gain relative to the average. clip(r t (θ), 1-ε, 1+ε) limits the policy update amplitude and prevents the update step from being too large, where ε is a small constant. is the strategy ratio, i.e., the probability ratio of the current strategy to the old strategy, θ old is the previous parameter of the policy network.

[0151] The Critic network estimates the value function of a given state where φ i Represents the parameters of the value network. The goal of the value network is to minimize the error of the value function estimate. The objective function of the critic network can be calculated by the mean square error (MSE), that is:

[0152]

[0153] Among them, V t target is the target value function, which is usually approximated by the discounted sum of rewards. The MAPPO algorithm performs the following steps in each iteration: (1) For each agent i, use its policy network Sample actions, execute actions, and collect experience data (s i ,a i ,r i ,s i '); (2) Calculate the advantage function and the target value function V t target ; (3) Update the parameters of the policy network and the value network to maximize J(θ) and minimize L respectively VF (φ i ). The pseudo code of camera arrangement optimization based on MAPPO algorithm is shown in Table 3.

[0154] Table 3

[0155]

[0156]

[0157] The method of this embodiment is experimentally verified:

[0158] The surveillance camera deployment method of this embodiment is verified on a Windows 10 computer equipped with an Intel(R) Core(TM) i5-6300HQ CPU, 16GB memory, and an NVIDIA GeForce GTX965M graphics card. The camera network coverage of the indoor digital twin area is optimized through optimization based on the MAPPO algorithm. The experiment involves mathematical modeling, optimization of the deployment plan, and the effectiveness of the method is verified by comparing the coverage effect before and after optimization.

[0159] (1) Experimental setup:

[0160] An indoor digital twin model of the D building of a certain university was constructed, especially the second floor as the experimental area. The effect of the optimization algorithm was verified by comparing the arrangement of surveillance cameras before and after the experiment. The floor plan and space dimensions are shown in Figure 6 .

[0161] The same model of camera is used, and its internal parameters are calibrated by the Zhang Zhengyou calibration method of monocular chessboard. The parameters are shown in Table 4. Due to actual installation restrictions, all cameras are arranged at the same horizontal height, and the roll angle is not considered.

[0162] Table 4

[0163]

[0164] The original layout of the indoor surveillance cameras on this floor is modeled, the external parameter information of the camera is obtained, and its position coordinates and orientation angle are recorded. The rotation angle of the surveillance camera φ∈[0,2π). The external parameter data is recorded in Table 5.

[0165] Table 5

[0166]

[0167] In this experiment, the MAPPO algorithm is used to train the optimization process. The task itself is continuous, and conditions need to be set to terminate the experimental training process. The initial position of each surveillance camera agent in the experiment is set as shown in Table 5. The specific parameters of the algorithm training process are shown in Table 6.

[0168] Table 6

[0169]

[0170] For the obstacle part in the scene area, this experiment uses the composition ratio of the corresponding grid in the grid map to describe it, that is, the composition ratio of the obstacle grid, as follows:

[0171]

[0172] Among them, S Obs is the obstacle coverage area, S All is the total area, Num Dark_grid Num is the number of black grids in the grid map, that is, grids covered by obstacles. Count_grid The total number of grid cells in the grid map.

[0173] For the monitorable part of the scene area, this experiment uses the number of grids in this part to quantify the coverage of the surveillance camera. The coverage rate is:

[0174]

[0175] Right now:

[0176]

[0177] Among them, S Cov is the monitoring coverage area, S is the monitorable area, and S Cam_i is the monitoring coverage area of ​​each surveillance camera in the scene, S Ove is the overlapping area of ​​all the fields of view of the surveillance cameras, S Bli Num is the field of view area blocked by all obstacles. Pale_grid is the number of gray grids in the grid map.

[0178] There are N surveillance cameras deployed in the scene, and there are K key areas. For each key area, there are C k,Cam_i , represents the coverage status of the i-th camera on the k-th key area. If C k,Cam_i =1 means the area is covered by the camera, and 0 means it is not covered. The degree of attention of each key area:

[0179]

[0180] Therefore, the average degree of attention to all key areas in the entire scene is:

[0181]

[0182] (2) Experimental results:

[0183] Different grid scales and obstacle ratio thresholds are used for rasterization. By analyzing the composition ratio of obstacle grids under different conditions, the most suitable rasterization parameters for the experimental area are obtained. From the data in Table 7, it can be seen that when the grid scale reaches 60, the obstacle grid composition ratio increases significantly. Therefore, a grid scale of 50 is more appropriate for rasterizing the region in this experiment.

[0184] Table 7

[0185]

[0186] From the data in Table 8, we can see that when the threshold is greater than 0.4, the composition ratio changes relatively little. Therefore, in the subsequent optimization process of this experiment, the gridding parameters with a grid scale of 50 and a proportion threshold of 0.4 are used to generate a grid map of the surveillance camera layout area.

[0187] Table 8

[0188]

[0189] Generate a grid map according to the optimal gridding parameters obtained after the above discussion. And put in the original surveillance camera information and the entrance and exit locations in the scene. Figure 7 The original surveillance camera position orientation and coverage are displayed. There are 7896 grids in the grid map, and there are 15 entrances and exits in the scene, that is, the locations of key areas; the original surveillance layout plan deploys 20 cameras. Through statistical analysis of the coverage, the surveillance camera monitoring area covers a total of 4099 grids, with a coverage rate of 70.32%. The average level of attention to all key areas is 2.14%. In the original layout plan, the coverage rate of the camera is general, and some areas cannot be effectively covered. At the same time, the level of attention to key areas is low. At this time, there are a lot of blind spots in the monitoring system, which cannot meet the needs of using indoor monitoring systems to build digital twins of building interiors.

[0190] Based on the parameter values ​​set in Table 6, the layout of the surveillance cameras is trained and optimized. During training, the maximum training round is set to 4000, and each round has a maximum of 1000 steps to explore the optimal layout. Figure 8The error trend of the surveillance camera placement network training process using the MAPPO algorithm. As shown in Figure 8, the error of the surveillance camera in the scene decreases rapidly in the first 1200 episodes. This may be because at the beginning of the training process, the surveillance camera has little knowledge of the scene environment information and moves too randomly in the scene, which may result in too many invalid movements. In the later rounds of training, the surveillance camera in the scene can use the strategy learned in the previous rounds and basically move in a more successful way. At this time, the strategy error in the network does not change much, showing a relatively stable oscillation trend. This part proves the rationality of the strategy setting of this method.

[0191] The reward value of reinforcement learning is an important indicator for evaluating training strategies. Fig. 9 This is the trend of the average reward per round when the surveillance camera layout network is trained using the MAPPO algorithm. As can be seen from the image, the cumulative average reward of the surveillance camera tends to converge when it reaches around 1650, and the action is executed according to the maximum reward. At the same time, the slope of the average reward of the surveillance camera in the first 1200 rounds is large and changes significantly, which is consistent with the trend of error changes. In the early stage, the intelligent agent is unknown to the environment, so the reward value is low but grows faster.

[0192] The trained network parameters are used for testing to obtain the optimized surveillance camera layout plan. The coverage of the cameras in the grid map is shown in the figure. Fig.10 As shown. Table 9 shows the various indicators of the surveillance camera layout plan before and after optimization. After analyzing the data in the table, it can be seen that after optimization, the number of grids in the monitoring coverage area is 4719, the coverage rate is 81.03%, and the average attention level to all key areas is 10.0%. Compared with before optimization, the coverage rate is increased by 10.71%, and the attention level to key areas is increased by 7.86%. It can be seen that while this method improves the coverage rate, the attention level to key areas is also improved to a certain extent, which can prove the effectiveness of the MAPPO algorithm proposed in this embodiment for optimizing the layout of indoor surveillance cameras.

[0193] Table 9

[0194]

[0195] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. An intelligent camera arrangement method for building digital twins, characterized in that: include: Get the scene to be arranged; Preprocessing the scene to be arranged to obtain obstacle areas and monitorable areas; Obtaining a preliminary arrangement plan of cameras through the obstacle area and the monitorable area, optimizing the preliminary arrangement plan based on the MAPPO algorithm, and obtaining a final arrangement plan; The camera arrangement in the scene to be arranged is completed based on the final arrangement solution.

2. The camera intelligent arrangement method for building digital twins according to claim 1 is characterized in that: Preprocessing the scene to be arranged includes: Preset a grid scale and a threshold, use the grid to divide the scene to be arranged, and obtain a grid map; The grids where the obstacles are located in the grid map are marked and encoded to obtain the obstacle area and the monitorable area.

3. The camera intelligent arrangement method for building digital twins according to claim 2 is characterized in that: The calculation method of the obstacle area is: Among them, Occ i,j is the occupancy rate of the obstacle in each grid (i, j) of the grid map, S B (i, j) is the occupancy of obstacles in each grid, S i,j is the size of each grid, Th is the preset proportion of obstacles in each grid, 0 means that the grid is considered as an obstacle-free area, and 1 means that the grid is considered as an obstacle area.

4. The camera intelligent arrangement method for building digital twins according to claim 1 is characterized in that: The preliminary arrangement scheme of obtaining cameras through the obstacle area and the monitorable area includes: Build a camera model; A preliminary arrangement of cameras is performed in the monitorable area based on the camera model to obtain the preliminary arrangement plan, wherein the preliminary arrangement plan includes the arrangement positions, angles, and quantities of the cameras.

5. The camera intelligent arrangement method for building digital twins according to claim 4 is characterized in that: The camera model is: Among them, Z C are the coordinate values ​​of the Z axis of each boundary point in the camera's visible range in the camera coordinate system. The coordinates of the boundary points in the camera's visible range are (x1, y1), (x2, y2), (x3, y3), and (x4, y4) respectively. A is the camera's intrinsic parameter matrix. M is the camera's extrinsic parameter matrix, which is defined by matrices R and T. R is the camera's rotation matrix, and T is the camera's translation matrix. u and v are the length and width of the camera's internal image sensor, respectively.

6. The camera intelligent arrangement method for building digital twins according to claim 1, characterized in that: The preliminary layout scheme is optimized based on the MAPPO algorithm to obtain the final layout scheme, including: Taking the camera as an intelligent agent, designing the state space, action space, and reward function of the intelligent agent; In the Actor network, define the policy network and policy network objective function of the agent; In the Critic network, the value network and the value network objective function of the agent are defined; Under the constraints of the policy network, value network, state space, and action space, the state and action of the agent are iteratively updated with the reward function, policy network objective function, and value network objective function as optimization targets to obtain the final deployment plan.

7. The camera intelligent arrangement method for building digital twins according to claim 6 is characterized in that: The state space is: <h2 style=";text-align:left;direction:ltr">S = [s1,s2,s3,…,s<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ] Where S is the state space, s i is the state of the ith agent; The action space includes: movement, rotation and quantity adjustment; The reward function is: R=∑(R NewCov +R ove +R bli +R All_cov )+R edge +R num Among them, R is the reward function, R NewCov To add coverage rewards, R All_cov To complete all coverage rewards, R ove is the field of view overlap reward, R bli is the blind spot reward, R edge Grid map area border reward, R num Added bonus for number of cameras.

8. The camera intelligent arrangement method for building digital twins according to claim 7, characterized in that: The policy network is The objective function of the strategy network is: Where a is the action taken by the agent in state s, θ is the parameter of the policy network, For expectations, is the advantage function, indicating taking action a t In status t The expected return gain relative to the average, clip(r t (θ), 1-ε, 1+ε) is the strategy update amplitude, ε is a constant; is the strategy ratio, θ old is the previous parameter of the policy network.

9. The camera intelligent arrangement method for building digital twins according to claim 7, characterized in that: The value network is The value network objective function is: Among them, φ i is the parameter of the value network, V t target is the target value function.

Citation Information

Patent Citations

  • Camera layout optimization method for large-scale scene monitoring

    CN104469322A

  • Automatic layout device based on deep reinforcement learning

    CN108597002A

  • Multi-agent reinforcement learning-based multi-machine air combat decision-making method

    CN113791634A

  • Digital twin distribution network fault scene generation method and system based on reinforcement learning

    CN116933619A

  • Thin transistor and display device including for the same

    KR1020250080363A

Cited By

  • Construction site monitoring arrangement method based on deep reinforcement learning

    CN119849888A

  • Modeled camera layout method and system

    CN120151667A

  • A model-based camera layout method and system

    CN120151667B

  • Monitoring equipment layout method and device based on digital twinning, equipment and medium

    CN121173935A

  • Monitoring device layout method and device based on digital twinning, equipment and medium

    CN121173935B