Artificial intelligence-based scene planning adjustment method and device, equipment and medium
By collecting actual images at insurance business outlets to generate heat maps of personnel distribution and using generative adversarial networks to adjust the area division, the problem of business area division being unable to meet real-time requirements was solved, improving the efficiency and accuracy of scene planning and enhancing the utilization rate of outlet scenes.
Patent Information
- Application Number
- CN202210924723.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-02
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-08-02
AI Technical Summary
The division of business areas for insurance outlets is insufficient to meet the needs of real-time business processing, resulting in low utilization of the service areas.
By collecting actual images of the site at multiple target time points, a personnel distribution heatmap is generated using a personnel detection model. Weighted overlay and trajectory information analysis are then performed. An adversarial generative network is used to generate updated regional images based on a comparison of the number of personnel with a preset threshold, guiding the adjustment of scene planning.
It improved the efficiency and accuracy of scene planning and enhanced the real-time utilization rate of network scene.
Smart Images

Figure CN115239508B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a scene planning adjustment method and device based on artificial intelligence, equipment and medium. BACKGROUND
[0002] At present, since the insurance business site needs to provide a plurality of different business handling services, in order to improve the service efficiency, a plurality of corresponding business areas are usually pre-divided by manual in the insurance business site according to the business handling amount.
[0003] However, the business handling amount has timeliness, that is, the handling amount of various types of business at different times fluctuates, and the handling time, waiting time and the like of various types of business will affect the utilization rate of the business area. In addition, factors such as policy changes and activity updates will also cause the business handling amount to change, thereby making the pre-divided business area difficult to meet the needs of real-time business handling customers. Therefore, how to dynamically manage the site area division to improve the real-time utilization rate of the site scene has become a problem to be solved. SUMMARY
[0004] Therefore, the embodiments of the present application provide a scene planning adjustment method and device based on artificial intelligence, equipment and medium to solve the problem of low real-time utilization rate of the site scene.
[0005] In a first aspect, the embodiments of the present application provide a scene planning adjustment method based on artificial intelligence, which comprises:
[0006] inputting the actual image of the site scene collected at N target time points into a trained personnel detection model to obtain a personnel distribution heat map corresponding to the target time point, N being an integer greater than zero;
[0007] weighting and superimposing the N personnel distribution heat maps, determining personnel trajectory information according to the superimposed result, and determining the number of personnel in each division area in the area division image according to the personnel trajectory information and the preset area division image;
[0008] for any division area, comparing the number of personnel in the division area with a preset threshold value of the division area, and if the comparison result meets a preset condition, inputting the area division image into a generative adversarial network to obtain an area update image;
[0009] updating the parameters of the generative adversarial network using the gradient descent method according to a generation loss function calculated based on the difference between the area update image and the area division image until the generation loss function converges, thereby obtaining a trained generative adversarial network;
[0010] input the region division image into the trained generative adversarial network to obtain a target region image, and the target region image is used to guide scene planning adjustment on the dot scene.
[0011] In a second aspect, an embodiment of the present application provides a scene planning adjustment device based on artificial intelligence, which comprises:
[0012] a personnel detection module configured to input actual images of the dot scene collected at N target time points into a trained personnel detection model to obtain a personnel distribution heat map corresponding to each target time point, N being an integer greater than zero;
[0013] a quantity determination module configured to superimpose the N personnel distribution heat maps by weighting, determine personnel trajectory information according to a superimposition result, and determine a number of personnel in each division region in the region division image according to the personnel trajectory information and a preset region division image;
[0014] a threshold comparison module configured to compare the number of personnel in any division region with a preset threshold value of the division region, and if a comparison result meets a preset condition, input the region division image into a generative adversarial network to obtain a region update image;
[0015] a network training module configured to update parameters of the generative adversarial network by using a gradient descent method according to a generative loss function calculated based on a difference between the region update image and the region division image, until the generative loss function converges, thereby obtaining a trained generative adversarial network;
[0016] an image generation module configured to input the region division image into the trained generative adversarial network to obtain a target region image, and the target region image is used to guide scene planning adjustment on the dot scene.
[0017] In a third aspect, an embodiment of the present application provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the scene planning adjustment method of the first aspect when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the scene planning adjustment method of the first aspect.
[0019] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0020] The actual image of the net point scene collected at N target time points is input into the trained personnel detection model to obtain a personnel distribution heat map corresponding to the target time points, the N personnel distribution heat maps are weighted and superimposed, personnel trajectory information is determined according to the superposition result, and the personnel trajectory information and a preset region division image are used to determine the number of personnel in each division region of the region division image. For any division region, the number of personnel in the division region is compared with a preset threshold value of the division region. If the comparison result meets a preset condition, the region division image is input into the generative adversarial network to obtain a region update image. The parameters of the generative adversarial network are updated by using the gradient descent method according to a generation loss function calculated based on the difference between the region update image and the region division image until the generation loss function converges, and the trained generative adversarial network is obtained. The region division image is input into the trained generative adversarial network to obtain a target update image. The generative adversarial network is learned online through the generation loss function, so that the scene planning adjustment scheme can be determined according to real-time personnel distribution information, the efficiency and accuracy of scene planning are improved, and the real-time utilization rate of the net point scene is improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 is an application environment schematic diagram of a scene planning adjustment method based on artificial intelligence provided by an embodiment of the present application;
[0023] Figure 2 is a flowchart of a scene planning adjustment method based on artificial intelligence provided by an embodiment of the present application;
[0024] Figure 3 is a flowchart of a scene planning adjustment method based on artificial intelligence provided by an embodiment of the present application;
[0025] Figure 4 is a structural schematic diagram of a scene planning adjustment device based on artificial intelligence provided by an embodiment of the present application;
[0026] Figure 5 is a structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0027] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, circuits, and
[0028] It will be understood that the terms "comprises" and / or "comprising," when used in this specification, include the presence of one or more features, integers, steps, operations, elements, and / or components described in the specification, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0029] It will be understood that the term "and / or," when used in the specification and in the following claims, is intended to mean one or more of the associated listed items can be present, and includes the possibilities of one or more of the associated listed items being present, and all possible combinations of one or more of the associated listed items.
[0030] As used in the description of the application and the following claims, the term "if" can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0031] In addition, the terms "first", "second", "third", etc. are used herein only to distinguish one element from another, and do not imply a relative importance or a given order.
[0032] The terms "one embodiment," "an embodiment," "some embodiments," and / or "other embodiments" as may be used herein do not necessarily all refer to the same embodiments, although they can. The terms "one embodiment," "an embodiment," "some embodiments," and / or "other embodiments" can be used interchangeably, and / or can refer to a single embodiment or several embodiments. The terms "at least one" and / or "one or more" can be used interchangeably, and / or can refer to at least one or one or more. The terms "including" and / or "having" can be used interchangeably, and / or can refer to a given number of one or more elements, integers, steps, operations, features, components, and / or groups thereof. The terms "including" and / or "having" can be used interchangeably, and / or can refer to a given number of one or more elements, integers, steps, operations, features, components, and / or groups thereof. The term "based on" can be used interchangeably with "based on and / or "based at least in part on," and / or can refer to one or more elements, integers, steps, operations, features, components, and / or groups thereof.
[0033] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. The artificial intelligence (AI) is a theory, method, technology and application system for using a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain optimal results.
[0034] The artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology and machine learning / deep learning, etc.
[0035] It should be understood that the size of the serial number of each step in the following embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0036] In order to illustrate the technical solutions of the present application, the following will be illustrated by specific embodiments.
[0037] The scene planning adjustment method based on artificial intelligence provided by the embodiment of the present application can be applied in the application environment such as Figure 1 The client communicates with the device end. The client includes but is not limited to a palm computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud terminal device, a personal digital assistant (PDA) and other computer devices. The device end can be realized by an independent image acquisition device or an image acquisition device cluster composed of multiple image acquisition devices.
[0038] Referring to Figure 2 The flowchart of the scene planning adjustment method based on artificial intelligence provided by the embodiment of the present application is shown in FIG. 1, and the scene planning adjustment method can be applied in Figure 1The client in the client computer device connected to the device end, the image acquisition device in the device end can be a camera, a video camera, etc., the image acquisition device has a storage function, i.e., the image acquisition device can store the collected dot scene image in the image acquisition device, the client corresponding computer device obtains the stored actual image of the dot scene from the device end, the client is deployed with a trained personnel detection model and a generative adversarial model, the trained personnel detection model can be used to extract personnel distribution information, and the generative adversarial model can be used to generate a target region image to guide the dot scene to adjust the scene planning. As shown in Figure 2 The scene planning adjustment method can include the following steps:
[0039] Step S201, input the actual image of the dot scene collected at N target time points into the trained personnel detection model to obtain the personnel distribution heat map corresponding to the target time point.
[0040] Wherein, N is an integer greater than zero, the target time point can be a pre-set image acquisition time point, the pre-set image acquisition time point can be included in the image acquisition time period, and the image acquisition time period is used to collect the dot scene image to determine the personnel distribution information in the image acquisition time period.
[0041] The dot scene can be a business dot scene, the business dot scene can be an insurance business handling scene, and the actual image can be a dot scene image collected by an image acquisition device. For subsequent processing, the actual image can be in the form of a top view.
[0042] The personnel detection model can be a neural network model, and the personnel distribution heat map can be an image representing personnel position information with a heat value.
[0043] Specifically, in this embodiment, the actual image in the form of a top view can be collected by a top-view camera deployed at the top of the dot scene. It should be noted that if a single top-view camera cannot collect a complete dot scene top view, the implementer can obtain the actual image by splicing images collected by multiple top-view cameras deployed at different positions at the top of the dot scene. In the case where the pose of each camera is known, the images collected by different cameras can be converted to the same image coordinate system according to the homography matrix corresponding to the camera pose. Generally, the ground coordinate system is used as the above-mentioned same image coordinate system. At this time, it is recommended that the multiple top-view cameras deployed at different positions at the top of the dot scene have overlapping regions, so as to facilitate verification of the splicing result and avoid the influence of camera pose deviation on the actual image obtained by splicing, thereby affecting the subsequent processing steps.
[0044] The N target time points are contained in the same image acquisition time period to ensure continuity of the target time points, so that personnel trajectory information can be extracted from actual images acquired at the N target time points. In this embodiment, the N target time points are time-sequentially continuous, and the interval between adjacent target time points is 0.5 seconds.
[0045] It should be noted that the personnel distribution heat map is consistent in size with the actual image, so as to facilitate quick determination of the real net point scene position corresponding to the personnel distribution. Since the pose of the image acquisition device used to acquire the actual image is known, each coordinate point in the actual image can be corresponded to a position in the real net point scene. The personnel distribution heat map is a gray image, and the value range of the gray value is [0, 1]. The greater the gray value of a pixel point, the shorter the time from the position corresponding to the pixel point to the personnel staying time at the time of acquisition.
[0046] In an embodiment, the actual image in the form of a top view can also be acquired by a camera with an oblique top view angle deployed above the net point scene. In this case, affine transformation needs to be performed on the acquired image to convert the acquired image into a top view image. Similarly, the implementer can obtain the actual image by splicing images acquired by a plurality of cameras with oblique top view angles deployed above the net point scene. In this case, affine transformation needs to be performed on each acquired image before the actual image is spliced.
[0047] Optionally, the personnel detection model comprises a first encoder and a first decoder, and historical images of the net point scene are used as training samples during training of the personnel detection model, and a mean square error loss is used as a loss function during training of the personnel detection model.
[0048] The training process of the personnel detection model comprises:
[0049] An image coordinate point corresponding to a personnel position in the historical image is obtained, a preset Gaussian kernel is used for convolution operation with the image coordinate point as the center to obtain a hot spot corresponding to the image coordinate point in the historical image, and the historical image containing the hot spot is determined as a label during training of the personnel detection model.
[0050] The training sample is input into the first encoder to extract features to obtain a sample scene feature.
[0051] The sample scene feature is input into the first decoder to obtain a sample personnel distribution heat map.
[0052] According to the sample personnel distribution heat map and the label, a mean square error loss is calculated, and the parameters of the personnel detection model are updated in reverse by using a gradient descent method based on the mean square error loss until the mean square error loss converges, so as to obtain the trained personnel detection model.
[0053] The historical image can be a scene image of a network point collected during historical personnel quantity statistics, the first encoder can be configured to extract features of the historical image, and the first decoder can be configured to reconstruct features of a sample scene feature.
[0054] The Gaussian kernel can be a convolution template corresponding to a Gaussian kernel function, the Gaussian kernel convolution process can be a Gaussian blurring process, and the hot spot can be a heat distribution region obtained after Gaussian kernel convolution.
[0055] The embodiment processes image coordinate points corresponding to personnel positions through Gaussian blurring to obtain heat distribution of the personnel positions, thereby providing a personnel detection model with a label rich in supervision information, and further ensuring the accuracy of the trained personnel detection model.
[0056] The above step of inputting actual images of the network point scene collected at the N target time points into the trained personnel detection model to obtain a personnel distribution heat map corresponding to the target time points can effectively represent the real position information of the personnel through a neural network model to improve the accuracy of subsequent personnel quantity statistics of each business area.
[0057] In step S202, the N personnel distribution heat maps are weighted and superimposed, personnel trajectory information is determined according to the superimposed result, and the number of personnel in each division area of the region division image is determined according to the personnel trajectory information and the preset region division image.
[0058] The weighted superimposition can be weighted superimposition of heat values of coordinates corresponding to the personnel distribution heat maps to be superimposed and heat values of coordinates corresponding to the superimposed personnel distribution heat maps, the heat value being a gray value, the personnel trajectory information can be movement information of the personnel, i.e., position information of the personnel at each target time point, and the region division image can be an image containing preset division business area information in the network point scene.
[0059] Specifically, the weighted superimposition can refer to assigning corresponding weights to the N personnel distribution heat maps, and the assignment of the weights can be determined according to the time sequence of the N personnel distribution heat maps, for example, the weight corresponding to the personnel distribution heat map is greater if the time sequence is later, and the weight corresponding to the personnel distribution heat map is smaller if the time sequence is earlier.
[0060] The area division image is also consistent with the actual image size, and when determining the number of personnel in each division area in the area division image, for any division area, a plurality of pixel points are included in the division area, personnel whose trajectory information points to the pixel points in the division area are counted to obtain a first statistical result, personnel who stay in the pixel points in the division area and stay for a time longer than a preset time threshold are counted to obtain a second statistical result, the first statistical result and the second statistical result are added, and the added result is determined as the number of personnel in the division area. It should be noted that the first statistical result and the second statistical result are not counted repeatedly, that is, the trajectories counted when obtaining the first statistical result are not used for the second statistical result. The preset time threshold is set to 5 seconds in this embodiment, and the implementer can adjust the preset time threshold according to the actual situation.
[0061] The above-mentioned steps of weighting and superimposing the N-personnel distribution heat map, determining the personnel trajectory information according to the superimposed result, and determining the number of personnel in each division area in the area division image according to the personnel trajectory information and the preset area division image, count the number of personnel through the personnel trajectory, avoiding the problem that the actual image collected instantaneously cannot completely determine the number of business handling personnel, and effectively improving the accuracy of personnel statistics.
[0062] In step S203, for any division area, the number of personnel in the division area is compared with a preset threshold value of the division area. If the comparison result meets a preset condition, the area division image is input into the generative adversarial network to obtain an area update image.
[0063] The preset threshold value can be a personnel quantity threshold value, which can be used to represent the personnel bearing capacity of the division area, that is, the maximum number of people allowed to handle and wait. The preset condition can be used to measure whether the number of personnel in the division area exceeds the personnel bearing capacity of the division area.
[0064] The generative adversarial network can include a generative model and an evaluation model. The generative model can be used to generate a new area update image, and the evaluation model can be used to evaluate the generated area update image. The area update image can be an image containing updated division area information.
[0065] Specifically, when the number of personnel in a division area is too large, the division area will be too crowded, which will bring a poor experience to personnel who need to handle business and affect the business handling efficiency. Therefore, the preset threshold value can be determined according to the actual area of the division area. For example, for a division area with an actual area of 3 square meters, the preset threshold value can be set to 3.
[0066] The generation model can comprise a second encoder and a second decoder, the second encoder having an input of the region division image and an output of region division features, the second encoder being configured to extract features of the region division image, the second decoder having an input of the region division features and an output of the region update image, the second decoder being configured to reconstruct the region division features.
[0067] The evaluation model can comprise a third encoder and a second fully connected layer, the third encoder having an input of the region update image and an output of region update features, the third encoder being configured to extract features of the region update image. The second fully connected layer has an input of the region update features and an output of the evaluation index, the second fully connected layer being configured to map the region update features to the evaluation index space, and the region update features need to be flattened when inputting into the second fully connected layer.
[0068] Optionally, if the comparison result meets the preset condition, the region division image is input into the generative adversarial network to obtain the region update image, which comprises:
[0069] Detecting whether the number of people in each division region is greater than the preset threshold of the corresponding division region, and if there is a division region whose number of people is greater than the preset threshold, detecting whether the number of people in any division region is less than the preset threshold of the corresponding division region.
[0070] If the number of people in any division region is less than the preset threshold of the corresponding division region, it is determined that the comparison result meets the preset condition, and the region division image is input into the generative adversarial network to obtain the region update image.
[0071] Wherein, the existence of a division region whose number of people is greater than the preset threshold indicates that the division region needs to be expanded to adapt to the actual number of people, but in the case of fixed area of the site scene, other division regions need to provide a certain area to expand, therefore, when the number of people in any division region is less than the preset threshold of the corresponding division region, the region division image is input into the generative adversarial network.
[0072] The embodiment determines whether the existing site scene area can be planned and optimized according to the comparison result of the number of people in each division region and the preset threshold, thereby avoiding invalid calculation and improving the efficiency of scene planning adjustment.
[0073] Optionally, after detecting whether the number of people in any division region is less than the preset threshold of the corresponding division region, the method further comprises:
[0074] If the number of people in any division region is not less than the preset threshold of the corresponding division region, it is determined that the comparison result does not meet the preset condition.
[0075] When the comparison result does not satisfy the preset condition, the sum of the areas of all the division regions is calculated, and the size of the scene after expansion is determined according to the calculation result and the preset expansion area.
[0076] When the number of personnel in any division region is less than the preset threshold of the corresponding division region, it indicates that the network scene cannot meet the actual number of personnel, and the preset expansion area can be the preset increase area of the network scene. In this embodiment, the preset expansion area is set to 15 square meters, and the size is used to guide the expansion adjustment of the scene planning by the management personnel.
[0077] In this embodiment, the size of the scene expansion is determined when the number of personnel in each division region exceeds the threshold, which avoids invalid calculation and improves the efficiency of scene planning adjustment.
[0078] The number of personnel in the division region is compared with the preset threshold of the division region, and if the comparison result satisfies the preset condition, the region division image is input into the generative adversarial network to obtain the region update image. The region update image obtained by the generative adversarial network can optimize the region update method while avoiding the consumption of many resources, thereby improving the efficiency of the planning adjustment of the network business scene.
[0079] In step S204, the parameters of the generative adversarial network are updated using the gradient descent method according to the generation loss function calculated based on the difference between the region update image and the region division image, until the generation loss function converges, and a trained generative adversarial network is obtained.
[0080] The difference between the region update image and the region division image can refer to the difference between the updated region in the region update image and the corresponding division region in the region division image.
[0081] The gradient descent method can be a stochastic gradient descent method, a batch gradient descent method, etc. The trained generative adversarial network can be an online learning updated generative adversarial network. Online learning can refer to real-time training and learning based on the current region division image and personnel distribution information, which can effectively adapt to changes in real-time information and improve the accuracy of region update image generation.
[0082] Specifically, in the region division image, each region can be represented by different pixel values, for example, the region division image contains 3 division regions, the pixel values of the pixel points contained in the first division region are all 1, the pixel values of the pixel points contained in the second division region are all 2, and the pixel values of the pixel points contained in the third division region are all 3, so that each division region can be quickly identified in a single region division image. Correspondingly, the pixel values of the pixel points contained in the first division region corresponding to the update region in the region update image are also all 1, the pixel values of the pixel points contained in the second division region corresponding to the update region in the region update image are also all 2, and the pixel values of the pixel points contained in the third division region corresponding to the update region in the region update image are also all 3.
[0083] Optionally, the loss function comprises a region loss term and a threshold loss term.
[0084] The calculation process of generating the loss function based on the difference between the region update image and the region division image comprises:
[0085] The division region in the region division image that does not meet the preset condition is determined as a target division region, and a reference division region corresponding to the target division region in the region update image is determined;
[0086] The distance between the center of gravity of the reference division region and the center of gravity of the target division region is calculated, and the calculation result is determined as the region loss term;
[0087] The ratio of the number of personnel in the target division region to the area of the reference division region is calculated to obtain a first personnel density;
[0088] The ratio of the preset threshold value of the target division region to the area of the target division region is calculated to obtain a second personnel density;
[0089] The first personnel density is subtracted from the second personnel density, and the mapping function is used to process the subtraction result to obtain the threshold loss term.
[0090] The target division region can be a division region that needs to be adjusted in area, and the reference division region can be a generated region corresponding to the division region that needs to be adjusted in area.
[0091] The center of gravity can be the geometric center of the region image, and the region loss term can be used to ensure that the division region does not have a large position offset before and after adjustment, so as to avoid causing the adjusted region to be far away from the business handling position.
[0092] The area can be obtained by pixel point statistics, the personnel density can be used to represent the personnel bearing capacity of the area, the second personnel density can be used to represent the theoretical personnel bearing capacity of the target division area, the first personnel density can be used to represent the actual personnel bearing capacity of the reference division area, when the first personnel density is less than or equal to the second personnel density, it indicates that the reference division area can accommodate the actual number of personnel at this time. The mapping function can be an exponential function.
[0093] Specifically, the mapping function is f(r)=max(e r -1, 0), that is, when the first personnel density is less than or equal to the second personnel density, the difference result is less than or equal to 0, at this time e r -1 is less than or equal to 0, then max(e r -1, 0) is 0, when the first personnel density is greater than the second personnel density, the difference result is greater than 0, at this time e r -1 is greater than 0, then max(e r -1, 0) is e r -1.
[0094] The embodiment supervises the training process through the threshold loss and the area loss, so as to ensure that the planning adjustment of the division area reduces the case of large area movement as much as possible while meeting the personnel quantity, thereby improving the utilization rate of the scene.
[0095] Optionally, the generated loss function further includes a shape loss term;
[0096] After obtaining the threshold loss term, further comprising:
[0097] The edge of the reference division area is obtained by an edge extraction algorithm, the edge includes M edge points, and M is an integer greater than zero;
[0098] The gradient of each edge point is calculated, and the mean value of the gradients of all edge points is subtracted from a preset gradient threshold to determine a subtraction result as the shape loss term.
[0099] The edge extraction algorithm can be extracted by Sobel operator, Laplace operator and the like, the edge can refer to the outer edge of the reference division area, and the edge point can refer to the pixel point constituting the edge.
[0100] The gradient can be used to represent the smoothness of the edge point, and the gradient threshold can be used to measure the complexity of the shape edge.
[0101] Specifically, when the gradient is greater than the gradient threshold, it indicates that the shape is relatively complex, at this time it is difficult to implement in the actual net point scene, therefore, the training process is supervised by the shape loss term.
[0102] The embodiment calculates the shape loss term through gradient, thereby effectively avoiding the situation that the shape of the reference division region is too complex to adjust in practice, and improving the feasibility of scene planning adjustment.
[0103] The generation loss function calculated according to the difference between the region update image and the region division image is updated by using the gradient descent method to update the parameters of the generative adversarial network until the generation loss function converges, and the trained generative adversarial network is obtained, and the generative adversarial network is trained in an online learning manner, which can effectively adapt to real-time personnel distribution information and region division images, thereby improving the accuracy of region update image generation.
[0104] In step S205, the region division image is input into the trained generative adversarial network to obtain a target region image.
[0105] The target region image is used to guide scene planning adjustment of the dot scene, and the target region image includes at least one target division region.
[0106] Specifically, according to the pixel points contained in each target division region in the target region image, the corresponding division region in the dot scene can be determined, and then scene planning adjustment is performed.
[0107] The above step of inputting the region division image into the trained generative adversarial network to obtain the target region image generates the target region image by using the trained generative adversarial network, ensures that the generated target region image meets the requirements of the evaluation model, and thereby improves the utilization rate of the dot scene.
[0108] The embodiment performs online learning on the generative adversarial network by using the generation loss function, thereby being able to determine a scene planning adjustment scheme according to real-time personnel distribution information, improving the efficiency and accuracy of scene planning, and thereby improving the real-time utilization rate of the dot scene.
[0109] Referring to Figure 3 is a flowchart of a scene planning adjustment method based on artificial intelligence provided in Embodiment Two of the present application, in which the N personnel distribution heat maps can be weighted and superimposed according to the pre-assigned weights corresponding to each personnel distribution heat map, or can be weighted and superimposed according to the weights corresponding to the superimposed personnel distribution heat map and the personnel distribution heat map to be superimposed.
[0110] When the weighted superposition is performed according to the pre-assigned weights corresponding to each personnel distribution heat map, the superposition process is described in Embodiment One and will not be repeated here.
[0111] When the weighted superposition is performed according to the weights corresponding to the superimposed personnel distribution heat map and the personnel distribution heat map to be superimposed, the superposition process includes:
[0112] Step S301, the nth personnel distribution heat map is determined as the to-be-stacked map, and the stacking result of the previous n-1 personnel distribution heat maps is determined as the temporary stacking result;
[0113] Step S302, the to-be-stacked map and the temporary stacking result are stacked according to the weighted stacking formula to obtain an updated stacking result;
[0114] Step S303, the value of n is increased by 1, and the step of determining the nth personnel distribution heat map as the to-be-stacked map and determining the stacking result of the previous n-1 personnel distribution heat maps as the temporary stacking result is executed again until n is the same as N, and the updated stacking result of the N personnel distribution heat maps is obtained.
[0115] Wherein, n is an integer greater than zero and less than or equal to N, the initial value of n is set to 1, the to-be-stacked map can refer to the personnel distribution heat map to be stacked, the temporary stacking result can refer to the stacking result of all stacked personnel distribution heat maps, and the updated stacking result can refer to the result after the to-be-stacked map is stacked.
[0116] Specifically, the weighted stacking formula is:
[0117] S n = αS n-1 +(1-α)s n
[0118] Wherein, S n may refer to the result after the nth personnel distribution heat map is stacked, S n-1 may refer to the result after the n-1th personnel distribution heat map is stacked, i.e. the result before the n th personnel distribution heat map is stacked, and s n may refer to the n th personnel distribution heat map, the value of n is in the range of [1, N], N is the number of personnel distribution heat maps, and α is the decay weight. The decay weight is used to gradually reduce the historical position information of the personnel, and accordingly, (1-α) is used to gradually record the current position information of the personnel, so that the personnel trajectory information can be obtained. In this embodiment, the decay weight is set to 0.95.
[0119] For example, for a coordinate point, the coordinate point has never had personnel stay, and from the n th target time point, the coordinate point has personnel stay continuously, then the heat value of the coordinate point gradually increases and tends to 1 from the n th personnel distribution heat map stacking; and if the coordinate point has personnel stay but the personnel leave from the n th target time point, then the heat value of the coordinate point gradually decreases and tends to 0 from the n th personnel distribution heat map stacking.
[0120] The embodiment can obtain more accurate personnel trajectory information according to the heat values, improve the accuracy of personnel quantity statistics, and thus obtain a more accurate scene planning adjustment mode, so as to more effectively improve the utilization rate of the network point scene.
[0121] A scene planning adjustment method based on artificial intelligence, Figure 4 A structure block diagram of a scene planning adjustment device based on artificial intelligence provided by Embodiment Three of the present application is shown, and the scene planning adjustment device is applied to a client. A computer device corresponding to the client is connected to a device end. An image acquisition device in the device end can be a camera, a video camera, etc. The image acquisition device has a storage function, that is, the image acquisition device can store the collected network point scene image in the image acquisition device. The computer device corresponding to the client obtains the stored actual image of the network point scene from the device end. The client is deployed with a trained personnel detection model and a generative adversarial network. The trained personnel detection model can be used to extract personnel distribution information, and the generative adversarial network can be used to generate a target region image to guide the network point scene to perform scene planning adjustment. For the convenience of description, only parts related to the embodiments of the present application are shown.
[0122] Referring to Figure 4 The scene planning adjustment device comprises:
[0123] The personnel detection module 41 is configured to input the actual images of the network point scene collected at N target time points into the trained personnel detection model to obtain a personnel distribution heat map corresponding to the target time points, and N is an integer greater than zero.
[0124] The quantity determination module 42 is configured to perform weighted superposition on the N personnel distribution heat maps, determine personnel trajectory information according to the superposition result, and determine the number of personnel in each division region in the region division image according to the personnel trajectory information and the preset region division image.
[0125] The threshold comparison module 43 is configured to compare the number of personnel in any division region with a preset threshold value of the division region. If the comparison result meets a preset condition, the region division image is input into the generative adversarial network to obtain a region update image.
[0126] The network training module 44 is configured to update the parameters of the generative adversarial network by using a gradient descent method according to a generation loss function calculated based on the difference between the region update image and the region division image, until the generation loss function converges, and thus a trained generative adversarial network is obtained.
[0127] The image generation module 45 is configured to input the region division image into the trained generative adversarial network to obtain a target region image, and the target region image is used to guide scene planning adjustment on the dot scene.
[0128] Optionally, the person detection model comprises a first encoder and a first decoder, and a historical image of the dot scene is used as a training sample during training of the person detection model, and a mean square error loss is used as a loss function during training of the person detection model.
[0129] The scene planning adjustment device further comprises:
[0130] The label acquisition module is configured to acquire an image coordinate point corresponding to a position of a person in the historical image, perform convolution operation on the image coordinate point using a preset Gaussian kernel to obtain a hot spot corresponding to the image coordinate point in the historical image, and determine the historical image containing the hot spot as a label during training of the person detection model.
[0131] The feature extraction module is configured to input the training sample into the first encoder to extract a sample scene feature.
[0132] The feature reconstruction module is configured to input the sample scene feature into the first decoder to obtain a sample person distribution heat map.
[0133] The model training module is configured to calculate a mean square error loss according to the sample person distribution heat map and the label, and update parameters of the person detection model in a reverse direction using a gradient descent method according to the mean square error loss until the mean square error loss converges, so as to obtain the trained person detection model.
[0134] Optionally, the quantity determination module 42 comprises:
[0135] The initialization unit is configured to determine the nth person distribution heat map as a to-be-stacked image, and determine a stacking result of the first n-1 person distribution heat maps as a temporary stacking result, n is an integer greater than zero and less than or equal to N, and an initial value of n is set to 1.
[0136] The stacking unit is configured to stack the to-be-stacked image and the temporary stacking result according to a weighted stacking formula to obtain an updated stacking result.
[0137] The iteration unit is configured to increase the value of n by 1, and execute again the steps of determining the nth person distribution heat map as the to-be-stacked image, and determining a stacking result of the first n-1 person distribution heat maps as the temporary stacking result, until n is the same as N, so as to obtain an updated stacking result of the N person distribution heat maps after weighted stacking.
[0138] Optionally, the threshold comparison module 43 comprises:
[0139] The first comparison unit is used to detect whether the number of people in each division area is greater than the preset threshold of the corresponding division area. If there is a division area with a number of people greater than the preset threshold, then it is used to detect whether there is any division area with a number of people less than the preset threshold of the corresponding division area.
[0140] The second comparison unit is used to determine that the comparison result meets the preset conditions if the number of people in any divided region is less than the preset threshold of the corresponding divided region, and inputs the region division image into the generative adversarial network to obtain the region update image.
[0141] Optionally, the threshold comparison module 43 mentioned above also includes:
[0142] The third comparison unit is used to determine that the comparison result does not meet the preset conditions if the number of people in any division area is less than the preset threshold of the corresponding division area.
[0143] The size calculation unit is used to calculate the sum of the areas of all divided regions when the comparison results do not meet the preset conditions. Based on the calculation results and the preset expansion area, the size of the scene after expansion is determined. The size is used to guide managers to expand and adjust the scene planning.
[0144] Optionally, the generated loss function includes a region loss term and a threshold loss term;
[0145] The aforementioned network training module 44 includes:
[0146] The region determination unit is used to determine the regions in the region division image that do not meet the preset conditions as target division regions, and to determine the reference division region corresponding to the target division region in the region update image.
[0147] The region loss calculation unit is used to calculate the distance between the centroid of the reference region and the centroid of the target region, and to determine the calculation result as the region loss term.
[0148] The first density calculation unit is used to calculate the ratio of the number of people in the target area to the area of the reference area to obtain the first personnel density;
[0149] The second density calculation unit is used to calculate the ratio of the preset threshold of the target division region to the area of the target division region to obtain the second personnel density;
[0150] The threshold loss calculation unit is used to subtract the first personnel density from the second personnel density, and to process the subtraction result using a mapping function to obtain the threshold loss term.
[0151] Optionally, the generation loss function may also include a shape loss term;
[0152] The aforementioned network training module 44 also includes:
[0153] an edge extraction unit configured to obtain edges of the reference division region by an edge extraction algorithm, the edges including M edge points, M being an integer greater than zero;
[0154] a shape loss calculation unit configured to calculate gradients of each edge point, and subtract a mean value of the gradients of all the edge points from a preset gradient threshold to determine a subtraction result as a shape loss term.
[0155] It should be noted that the information interaction and execution process between the above modules and units are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by them can be referred to the method embodiments part, which will not be repeated here.
[0156] Figure 5 A structural schematic diagram of a computer device for the fourth embodiment of the present application is shown in FIG. 4. As shown in the figure, the computer device of this embodiment includes at least one processor (only one is shown in the figure), a memory, and a computer program stored in the memory and executable on the at least one processor, and the processor executes the computer program to implement the steps in any one of the above-mentioned scene planning adjustment method embodiments based on artificial intelligence. Figure 5 Figure 5 The computer device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that the computer device is only an example of the computer device, and does not constitute a limitation on the computer device, and the computer device can include more or fewer components than the figure, or combine certain components, or different components, for example, it can also include a network interface, a display screen, and an input device, etc.
[0157] The computer device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that the computer device is only an example of the computer device, and does not constitute a limitation on the computer device, and the computer device can include more or fewer components than the figure, or combine certain components, or different components, for example, it can also include a network interface, a display screen, and an input device, etc. Figure 5 The processor can be a CPU, and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0158] The processor can be a CPU, and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0159] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be a memory of the computer device, and the internal memory provides an environment for running of the operating system and the computer-readable instructions in the readable storage medium. The readable storage medium can be a hard disk of the computer device, and in other embodiments, can also be an external storage device of the computer device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory can include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a BootLoader, data, and other programs, such as program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.
[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the unit and module in the above device can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. If the integrated unit is realized in the form of software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the above-mentioned embodiment methods, which can be realized by a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer readable medium cannot be electrical carrier signal and telecommunication signal.
[0161] The present application realizes all or part of the processes in the above-mentioned embodiment methods, which can also be completed by a computer program product. When the computer program product runs on the computer equipment, it makes the computer equipment execute the steps in the above-mentioned embodiment methods.
[0162] In the above-mentioned embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0163] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0164] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other manners. For example, the described apparatus / computer device embodiments are merely schematic. For example, the division of the modules or units can be different, and each can include a plurality of sub-units. Some or all of the modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0165] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e. may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0166] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An artificial intelligence-based scene planning adjustment method, characterized in that, The method comprises: inputting actual images of a net point scene collected at N target time points into a trained personnel detection model to obtain personnel distribution heat maps corresponding to the target time points, N being an integer greater than zero; superimposing the N personnel distribution heat maps by weighting, determining personnel trajectory information according to a superimposition result, and determining the number of personnel in a divided region in a region division image according to the personnel trajectory information and a preset region division image; for any divided region, comparing the number of personnel in the divided region with a preset threshold value of the divided region, and if a comparison result meets a preset condition, inputting the region division image into a generative adversarial network to obtain a region update image; updating parameters of the generative adversarial network by using a gradient descent method according to a generative loss function calculated based on a difference between the region update image and the region division image until the generative loss function converges, thereby obtaining a trained generative adversarial network; inputting the region division image into the trained generative adversarial network to obtain a target region image, the target region image being used to guide scene planning adjustment of the net point scene; the personnel detection model comprises a first encoder and a first decoder, historical images of a net point scene are used as training samples of the personnel detection model, and a mean square error loss is used as a loss function of the personnel detection model; the training process of the personnel detection model comprises: obtaining image coordinate points of personnel positions in the historical images, performing convolution on the image coordinate points by using a preset Gaussian kernel to obtain hot spots of the image coordinate points in the historical images, and determining historical images containing the hot spots as labels of the personnel detection model; inputting the training samples into the first encoder to extract sample scene features; inputting the sample scene features into the first decoder to obtain sample personnel distribution heat maps; calculating the mean square error loss according to the sample personnel distribution heat maps and the labels, and updating parameters of the personnel detection model by using a gradient descent method according to the mean square error loss until the mean square error loss converges, thereby obtaining a trained personnel detection model; the generative loss function comprises a region loss term and a threshold value loss term; the calculation process of the generative loss function calculated based on a difference between the region update image and the region division image comprises: determining a target divided region that does not meet the preset condition in the region division image as a reference divided region in the region update image; calculating a distance between the center of gravity of the reference divided region and the center of gravity of the target divided region to determine a calculation result as the region loss term; calculating a ratio of the number of personnel in the target divided region to the area of the reference divided region to obtain a first personnel density; calculating a ratio of the preset threshold value of the target divided region to the area of the target divided region to obtain a second personnel density; subtracting the first personnel density from the second personnel density, processing a subtraction result by using a mapping function to obtain the threshold value loss term.
2. The scene planning adjustment method of claim 1, wherein, the weighted superimposition of the N personnel distribution heat maps comprises: determining an nth personnel distribution heat map as a to-be-stacked map and determining a stacking result of the first n-1 personnel distribution heat maps as a temporary stacking result, n being an integer greater than zero and less than or equal to N, an initial value of n being set as 1; stacking the to-be-stacked map and the temporary stacking result according to a weighted stacking formula to obtain an updated stacking result; increasing the value of n by 1, and performing again the steps of determining an nth personnel distribution heat map as a to-be-stacked map and determining a stacking result of the first n-1 personnel distribution heat maps as a temporary stacking result until n is the same as N, to obtain an updated stacking result of the N personnel distribution heat maps.
3. The method of claim 1, wherein, If the comparison result meets a preset condition, inputting the region division image into a generative adversarial network to obtain a region update image includes: detecting whether the number of personnel in each division region is greater than a preset threshold value of the corresponding division region, and if there is a division region in which the number of personnel is greater than the preset threshold value, detecting whether the number of personnel in any division region is less than a preset threshold value of the corresponding division region; If the number of personnel in any division region is less than the preset threshold value of the corresponding division region, it is determined that the comparison result meets the preset condition, and the region division image is input into a generative adversarial network to obtain a region update image.
4. The scene planning adjustment method of claim 3, wherein, After detecting whether the number of personnel in any division region is less than a preset threshold value of the corresponding division region, the method further includes: If there is no division region in which the number of personnel is less than the preset threshold value of the corresponding division region, it is determined that the comparison result does not meet the preset condition. When the comparison result does not meet the preset condition, calculating the sum of the areas of all division regions, and determining the size of the expanded scene according to the calculation result and a preset expansion area, the size being used to guide the expansion adjustment of the scene planning by the management personnel.
5. The method of claim 1, wherein, The generation loss function further includes a shape loss term; After obtaining the threshold loss term, the method further includes: obtaining the edge of the reference division region through an edge extraction algorithm, the edge including M edge points, M being an integer greater than zero; calculating the gradient of each edge point, and subtracting the average gradient of all edge points from a preset gradient threshold value to determine the subtraction result as the shape loss term.
6. An artificial intelligence-based scene planning adjustment apparatus for implementing the scene planning adjustment method according to any one of claims 1 to 5, characterized in that, The scene planning adjustment device includes: a personnel detection module configured to input actual images of a network scene collected at N target time points into a trained personnel detection model to obtain personnel distribution heat maps corresponding to the target time points, N being an integer greater than zero; a number determination module configured to perform weighted stacking on the N personnel distribution heat maps, determine personnel trajectory information according to a stacking result, and determine the number of personnel in a division region in a region division image according to the personnel trajectory information and the region division image; a threshold comparison module configured to compare the number of personnel in any division region with a preset threshold value of the division region, and if the comparison result meets a preset condition, input the region division image into a generative adversarial network to obtain a region update image. a network training module configured to update parameters of the generative adversarial network by using a gradient descent method according to a generative loss function calculated based on a difference between the region update image and the region division image until the generative loss function converges, to obtain a trained generative adversarial network; an image generation module configured to input the region division image into the trained generative adversarial network to obtain a target region image, the target region image being used to guide scene planning adjustment on the dot scene.
7. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the scene planning adjustment method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executable on the processor to implement the scene planning adjustment method according to any one of claims 1 to 5.
Citation Information
Patent Citations
An urban people flow prediction method based on a Seq2Seq generative adversarial network
CN109902880A
Pedestrian trajectory prediction method based on generative adversarial network
CN111339867A