AI-based behavior control method and system
By acquiring and identifying subject images at the area entrance, tracking their motion trajectory, and identifying close-up videos based on AI, the problem of slow recognition speed in multi-person recognition tasks is solved, improving the recognition efficiency and training the local recognition model.
Patent Information
- Application Number
- CN202510690718.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
AI is slow to identify in multi-person recognition tasks, resulting in inefficient recognition, especially in scenarios with a large number of people.
By acquiring the subject image at the area entrance, identifying the subject area, synchronously extracting the subject features, and inserting them into the area feature library to track the subject motion trajectory in real time. The close-up video is recognized based on AI and the recognition results are recorded to train the local recognition model.
The efficiency of the AI recognition process is improved, the total time-consuming of the recognition task is shortened, and the recognition efficiency is further improved through the training of local models.
Smart Images

Figure CN120220251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent supervision, and specifically to an AI-based behavior control method and system. Background Art
[0002] With the progress of AI technology, the application scenarios of AI are increasing. For example, it is used for behavior control in areas. In some public places or places with frequent personnel flow, the application of AI can greatly relieve the work pressure of management personnel. However, although AI has strong recognition ability and a wide recognition range, its recognition speed is very slow, measured in seconds. When the number of people is large, the time-consuming of the recognition process is extremely long, affecting the recognition efficiency. How to optimize the AI recognition process and improve the recognition efficiency for the recognition task of multiple people is the technical problem that the technical solution of the present invention wants to solve. Summary of the Invention
[0003] The purpose of the present invention is to provide an AI-based behavior control method and system to solve the problems raised in the above background art.
[0004] To achieve the above purpose, the present invention provides the following technical solutions: An AI-based behavior control method and system, the method includes: Obtain a subject image at the entrance of the area, recognize the subject image to determine the subject area, and synchronously extract subject features; Insert the subject features into the area feature library, and based on the area feature library, track the area video in real time to determine the subject movement trajectory; the acquisition accuracy of the area video is a preset first accuracy; Locate the abnormal subject according to the subject movement trajectory, collect the close-range video of the abnormal subject based on the second accuracy, and recognize the close-range video based on AI; the first accuracy is a constant, the second accuracy is a variable, and the second accuracy is related to the positioning result and the recognition result; Record the close-range video recognized by AI and its recognition result, and train the local recognition model; the local recognition model is a neural network model.
[0005] As a further solution of the present invention: the step of obtaining a subject image at the entrance of the area, recognizing the subject image to determine the subject area, and synchronously extracting subject features includes: Install a camera with a temperature measurement module at the entrance of the area, and the camera obtains the entrance image containing temperature information in real time; Locate the subject area in the entrance image based on the temperature information; Traverse the subject area, calculate the horizontal gradient and vertical gradient of each pixel point in the subject area, and when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition, mark the pixel point; Count the pixel points with marks to obtain the main contour, and construct the main features according to the main contour.
[0006] As a further solution of the present invention: The steps of counting the pixel points with marks to obtain the main contour and constructing the main features according to the main contour include: Count the pixel points with marks to obtain the main contour; Extract the layers of the internal area of the main contour in different channels, traverse the pixel points in each layer, record the values of the pixel points, and construct an array; the traversal order of the pixel points in all layers is the same; For each array, calculate the independent value of each numerical value in order; the independent value is used to represent the degree of difference between each numerical value and other numerical values in the array; Accumulate the independent values, and when the independent value reaches a preset value, mark the corresponding serial number; Screen the serial numbers, and use the screened serial numbers as the main features.
[0007] As a further solution of the present invention: The steps of inserting the main features into the regional feature library, tracking the regional video in real time based on the regional feature library, and determining the main body movement trajectory include: Insert the main features into the regional feature library; Read the regional video, and select video frames in the regional video according to a preset time step; Read the main features in the regional feature library in sequence, traverse the selected video frames, and determine the main body position corresponding to the main features; Statistically calculate the center point of the main body positions of the same main features according to the time sequence of the video frames; Obtain the regional map, select mapping points in the regional map based on the center point, synchronously determine the color values, and fit all the mapping points to obtain the main body movement trajectory corresponding to the main features; Among them, when the main body position traversed by the main features in the regional feature library is empty, reduce the time step. When the reduced time step is less than the preset step threshold and the duration of the empty main body position traversed is greater than the preset duration threshold, delete the main features in the regional feature library.
[0008] As a further solution of the present invention: The steps of locating the abnormal main body according to the main body movement trajectory, collecting the close-up video of the abnormal main body based on the second precision, and identifying the close-up video based on AI include: Receive the backtracking time determined by the staff; Obtain all the main body movement trajectories within the backtracking time based on the regional map; Perform pixel clustering on the regional map containing the main body movement trajectories to obtain sub-regions; Calculate the average pixel color value within each sub-region, and determine the region to be analyzed based on the average pixel color value; Determine the magnification factor based on the average pixel color value, obtain the close-up video within the region to be analyzed based on the magnification factor, and perform recognition on the close-up video using AI; Recursively adjust the magnification factor according to the AI recognition result.
[0009] As a further solution of the present invention: The step of recording the close-up video recognized by AI and its recognition result, and training the local recognition model includes: Record the close-up video recognized by AI and its recognition result; Extract features from the close-up video to obtain video features; Construct a sample set from the video features to the recognition result, and train a neural network model; When the error rate of the neural network model is less than the preset error rate threshold, output the neural network model as the local recognition model.
[0010] The technical solution of the present invention also provides an AI-based behavior control system, and the system includes: A main body feature extraction module, configured to obtain a main body image at the entrance of the region, perform recognition on the main body image to determine the main body region, and synchronously extract main body features; A main body tracking module, configured to insert the main body features into the region feature library, and perform real-time tracking on the region video based on the region feature library to determine the main body movement trajectory; the acquisition accuracy of the region video is a preset first accuracy; An AI target recognition module, configured to locate an abnormal main body according to the main body movement trajectory, collect a close-up video of the abnormal main body based on a second accuracy, and perform recognition on the close-up video using AI; the first accuracy is a constant, the second accuracy is a variable, and the second accuracy is related to the positioning result and the recognition result; A local model training module, configured to record the close-up video recognized by AI and its recognition result, and train a local recognition model; the local recognition model is a neural network model.
[0011] As a further solution of the present invention: The main body feature extraction module includes: An entrance image acquisition unit, configured to install a camera with a temperature measurement module at the entrance of the region, and the camera obtains an entrance image containing temperature information in real time; A region positioning unit, configured to locate the main body region in the entrance image based on the temperature information; A pixel point marking unit, configured to traverse the main body region, calculate the horizontal gradient and vertical gradient of each pixel point in the main body region, and mark the pixel point when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition; A contour construction unit for counting marked pixel points to obtain a main contour and constructing main features based on the main contour.
[0012] As a further solution of the present invention: The main body tracking module includes: A feature insertion unit for inserting the main body features into the regional feature library; A video frame selection unit for reading the regional video and selecting video frames in the regional video according to a preset time step; A position determination unit for successively reading the main body features in the regional feature library, traversing the selected video frames, and determining the main body position corresponding to the main body feature; A center point calculation unit for statistically calculating all the main body positions of the same main body feature according to the time sequence of the video frames and calculating the center point of the main body positions; A fitting unit for obtaining a regional map, selecting mapping points in the regional map based on the center point, synchronously determining color values, and fitting all the mapping points to obtain the main body movement trajectory corresponding to the main body feature; Wherein, when the main body position traversed by the main body feature in the regional feature library is empty, the time step is reduced. When the reduced time step is less than the preset step threshold and the duration of the empty main body position traversed is greater than the preset duration threshold, the main body feature is deleted from the regional feature library.
[0013] As a further solution of the present invention: The AI target recognition module includes: A retrospective time receiving unit for receiving the retrospective time determined by the staff; A trajectory acquisition unit for acquiring all the main body movement trajectories within the retrospective time based on the regional map; A pixel point clustering unit for clustering pixel points in the regional map containing the main body movement trajectory to obtain sub-regions; An average value calculation unit for calculating the average pixel color value within each sub-region and determining the region to be analyzed according to the average pixel color value; An average value application unit for determining the magnification factor according to the average pixel color value, obtaining a close-up video within the region to be analyzed based on the magnification factor, and performing recognition on the close-up video based on AI; A recursive adjustment unit for recursively adjusting the magnification factor according to the AI recognition result.
[0014] Compared with the prior art, the beneficial effects of the present invention are: The present invention performs main body recognition on the acquired video, determines the movement trajectory of the main body, selects some regions according to the movement trajectory, applies AI for recognition, reduces the recognition task volume, thereby shortening the total time-consuming of the recognition task. At the same time, a local model is distilled according to the recognition result, further improving the recognition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0016] Figure 1 Shows the overall flowchart of the AI-based behavior control method.
[0017] Figure 2 Shows the structural diagram of the AI-based behavior control system. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] Figure 1 For the overall flowchart of the AI-based behavior control method and system, in an embodiment of the present invention, an AI-based behavior control method, the method includes: Step S100: Obtain a subject image at the entrance of the area, identify the subject image, determine the subject area, and synchronously extract subject features; The technical solution of the present invention is applied to the personnel monitoring scenario of the area, especially the scenario where personnel cannot be pre-registered, such as most existing public places or some production areas with frequent personnel transfers. The management parties of these scenarios will pre-install cameras to obtain images within the area; for the areas involved in the technical solution of the present invention, their entrances will be pre-set, and the cameras installed at the entrances of the areas generally have relatively high clarity and relatively high working frequency, and obtain images in real time. When a person is detected, it is called a subject image. By identifying the subject image, the subject area can be determined, and by analyzing the subject area, subject features can be extracted from the subject area.
[0020] Step S200: Insert the subject features into the area feature library, and based on the area feature library, track the area video in real time to determine the subject movement trajectory; the acquisition accuracy of the area video is a preset first accuracy; After the main body features are detected, they are inserted into the regional feature library. During the detection stage, the regional video is traversed based on each main body feature in the regional feature library, and the corresponding main body can be tracked. All the tracked positions are extracted to obtain the trajectory of each main body, which is called the main body movement trajectory. In addition, the regional video is obtained by a camera installed in the region. The accuracy of the regional video can be lower, which is the first accuracy in the above content. The same camera can detect a larger range.
[0021] Step S300: Locate the abnormal main body according to the main body movement trajectory, collect the close-up video of the abnormal main body based on the second accuracy, and identify the close-up video based on AI; the first accuracy is a constant, the second accuracy is a variable, and the second accuracy is related to the positioning result and the identification result; By analyzing all the extracted main body movement trajectories, some main bodies that may be abnormal can be selected. At this time, the close-up video of the abnormal main body is obtained by a camera installed in the region. At this time, the accuracy is higher, which is the second accuracy in the above content. After obtaining the close-up video, the close-up video is identified based on AI, and a more accurate identification result can be obtained.
[0022] Among them, regarding the relationship between the first accuracy and the second accuracy, a feasible adjustment method is to link the accuracy with the magnification factor. The first accuracy corresponds to a smaller magnification factor. At this time, the monitoring range of the camera is large, but the detail degree is insufficient. The second accuracy corresponds to a larger magnification factor. At this time, the camera only obtains the video of a small area, and the monitoring range is very small.
[0023] Step S400: Record the close-up video identified by AI and its identification result, and train the local identification model; the local identification model is a neural network model; The existing AI has extremely strong recognition ability and high recognition accuracy, but it consumes a lot of resources and the recognition speed is not so fast. Therefore, the technical solution of the present invention records the close-up video identified by AI and its identification result, and then trains a local identification model. Since the behavior types in a region are highly repetitive, the data volume of the local identification model may be very small and the recognition speed is extremely fast.
[0024] Regarding step S100, the steps of obtaining the main body image at the regional entrance, identifying the main body image, determining the main body area, and synchronously extracting the main body features include: Install a camera with a temperature measurement module at the regional entrance, and the camera obtains the entrance image containing temperature information in real time; Locate the main body area in the entrance image based on the temperature information; Traverse the main body area, calculate the horizontal gradient and vertical gradient of each pixel point in the main body area, and mark the pixel point when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition; Count the marked pixel points to obtain the main body contour, and construct the main body features according to the main body contour.
[0025] In an example of the technical solution of the present invention, the feature extraction process at the area entrance is described. A camera with a temperature measurement module is installed at the area entrance, and the entrance image containing temperature information is obtained in real time by the camera. The temperature information is used to simplify the target positioning process. Based on the temperature information, the main body area is located in the entrance image. Traverse the main body area, calculate the horizontal gradient and vertical gradient of each pixel point in the main body area. The horizontal gradient represents the horizontal difference of the pixel point, and the vertical gradient represents the vertical difference of the pixel point. When the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition, mark the pixel point; at this time, the marked pixel point is the contour point. Count the marked pixel points to obtain the main body contour, and construct the main body features according to the main body contour.
[0026] Further, the steps of counting the marked pixel points to obtain the main body contour and constructing the main body features according to the main body contour include: Count the marked pixel points to obtain the main body contour; Extract the layers of the internal area of the main body contour in different channels, traverse the pixel points in each layer, record the values of the pixel points, and construct an array; the traversal order of the pixel points in all layers is the same; For each array, calculate the independent value of each numerical value in sequence; the independent value is used to represent the degree of difference between each numerical value and other numerical values in the array; Accumulate the independent values, and mark the corresponding serial number when the independent value reaches the preset value; Screen the serial numbers, and use the screened serial numbers as the main body features.
[0027] After obtaining the main body contour, extract the layers of the internal area of the main body contour in different channels. According to the preset order, convert the pixel points in the layer into an array. For example, read the values of each pixel point in the order from left to right and from top to bottom. This process is a dimensionality reduction process, and the information in the layer will be converted into an array; for each array, calculate the difference between each numerical value and other numerical values in turn. If the difference is small, it can be considered that it forms a region with the surrounding pixel points. At this time, mark the corresponding serial number; count the marked serial numbers corresponding to each layer, which can be used as the main body features.
[0028] Regarding the calculation process of the independent value, for each element, calculate the difference between its value and the values of other elements, and then accumulate them. Considering the distance factor, this application introduces a weight coefficient so that the elements closer to the current element have a greater impact on the current element. Generally, the larger the difference, the greater the difference between the current element and other elements, the higher the independence, and the larger the independent value. Therefore, a feasible calculation method is as follows: The calculation process of the independent value is as follows: ; where is a preset parameter, is the distance between the th element and the current element in the image, N is the total number of elements, is the difference between the value of the
[0029] th element and the value of the current element; during the calculation process, the independent value is inversely proportional to the sum of the differences.
[0030] Regarding step S200, the steps of inserting the main body feature into the region feature library, tracking the region video in real time based on the region feature library, and determining the main body movement trajectory include: Insert the main body feature into the region feature library; Read the region video and select video frames in the region video according to the preset time step; Read the main body features in the region feature library in sequence, traverse the selected video frames, and determine the main body position corresponding to the main body feature; Statistically calculate all the main body positions of the same main body feature according to the time sequence of the video frames, and calculate the center point of the main body positions; Obtain the region map, select mapping points in the region map based on the center point, synchronously determine the color values, and fit all the mapping points to obtain the main body movement trajectory corresponding to the main body feature.
[0031] The region feature library contains multiple main body features, and all these main body features need to be applied. Reading the region video, the acquisition frequency of the region video is very high, maybe 24 frames per second, and the number of images is very large. If each image is analyzed, a large amount of computing resources will be consumed. Therefore, the present invention defines a time step, such as one second. Selecting video frames in the region video according to the preset time step means selecting one image every second, which greatly simplifies the data processing process. And during the trajectory recognition process, due to the continuity of space and people not being able to teleport instantaneously, this simplified data processing process can still obtain very accurate trajectories.
[0032] Specifically, regarding the data processing process, the main features are read from the regional feature library in sequence, the selected video frames are traversed, the main position corresponding to the main feature is determined, all the main positions of the same main feature are statistically analyzed according to the time sequence of the video frames, the center point of the main position is calculated (the center point calculation process belongs to conventional image processing techniques), the regional map is obtained, the mapping points are selected in the regional map based on the center point, the color values are determined synchronously, and all the mapping points are fitted to obtain the main motion trajectory corresponding to the main feature.
[0033] Among them, the method of inserting color values in the regional map is as follows: a circular area is constructed with the mapping point corresponding to the center point as the center and a preset value as the radius, and a preset unit color value is superimposed in the circular area; the trajectory generation process is similar to a "drawing" process. After obtaining the regional map, every time the main position is detected, a color value is inserted at the main position. The more frequently a certain position appears, the larger the corresponding color value; at this time, the larger the color value, the longer the residence time of the main body; for each main body, its corresponding trajectory contains a unique label, which is used to represent the correspondence between the trajectory and the main body. In addition, the radius of the circular area in the above content, its function is to adjust the width of the trajectory.
[0034] As a preferred embodiment of the technical solution of the present invention, an update solution for the regional feature library is introduced, which is specifically as follows: when the main position traversed by the main feature in the regional feature library is empty, the time step is reduced. When the reduced time step is less than the preset step threshold and the duration of the empty main position traversed is greater than the preset duration threshold, the main feature is deleted from the regional feature library.
[0035] The meaning of this process is that if a certain main feature does not appear in the regional video, the time step is reduced to obtain more images for traversal. If not, it continues to be reduced until it is small enough (step threshold). If not, it queries how long this main feature has been applied, that is, how long the main feature has not been detected. If the time is long enough (duration threshold), the main feature is deleted from the regional feature library.
[0036] It is worth mentioning that the practical significance of this deletion method lies in that if a main feature is not detected for a long time at a high enough frequency, it means that the corresponding main body has disappeared in the area and detection will no longer be carried out. At this time, if there are exits (usually there are multiple exits), the main body is detected in the exit video to obtain the whereabouts of the main body. According to the whereabouts of the main body, it can be determined whether the main body has left or is still in the area. If it is still in the area, it means that the main body has disappeared in the area for a long time. At this time, a warning message is generated. The update logic of the traditional regional feature library is to set cameras and detection logics corresponding to the entrance at the exit. Once a main body is detected leaving the area, the corresponding main feature is deleted, and the residence time of each main body is recorded. If it is long enough, a warning message is generated. This method is also feasible and is a different logic from the above solution. The difference is that the architecture of the technical solution of the present invention has a process of adjusting the time step. In other words, for a main body that is not easy to detect, a higher frequency is used for tracking.
[0037] It is worth mentioning that there may be many situations where there is no match in the present invention. For example, if the posture of the main body changes or is blocked, its state in the image will be different from the main feature, and a matching failure may occur.
[0038] Regarding step S300, the steps of locating the abnormal main body according to the movement track of the main body, collecting the close-up video of the abnormal main body based on the second accuracy, and identifying the close-up video based on AI include: Receiving the backtracking time determined by the staff; Obtaining all the movement tracks of the main body within the backtracking time based on the regional map; Performing pixel clustering on the regional map containing the movement track of the main body to obtain sub-regions; Calculating the average pixel color value in each sub-region, and determining the area to be analyzed according to the average pixel color value; Determining the magnification factor according to the average pixel color value, obtaining the close-up video in the area to be analyzed based on the magnification factor, and identifying the close-up video based on AI; Recursively adjusting the magnification factor according to the AI recognition result.
[0039] In an example of the technical solution of the present invention, the received retrospective time determined by the staff is used as the starting point of time at the current moment, and all the main body movement trajectories within the retrospective time are obtained forward. These main body movement trajectories are inserted into the same regional map. Then, pixel clustering is performed on the regional map containing the main body movement trajectories to obtain sub-regions. The calculation process of the pixel difference used in the clustering process includes two types: position difference and color value difference. A conventional clustering scheme can be used for the clustering scheme, such as the K-means clustering scheme or other clustering schemes without limiting the number of clusters; calculate the average pixel color value within each sub-region. The larger the average pixel color value, the longer the residence time, and the higher the importance of the corresponding region. Select a class of pixel points with an average pixel color value greater than the preset average threshold value as the area to be analyzed. Regarding step S400, the steps of recording the close-up video recognized by AI and its recognition results and training the local recognition model include: Record the close-up video recognized by AI and its recognition results; Extract features from the close-up video to obtain video features; Construct a sample set from video features to recognition results and train a neural network model; When the error rate of the neural network model is less than the preset error rate threshold, output the neural network model as the local recognition model.
[0040] In an example of the technical solution of the present invention, the training process of the local recognition model is described. Record the close-up video recognized by AI and its recognition results, extract features from the close-up video to obtain video features, construct a sample set from video features to recognition results, and train a neural network model; when the error rate of the neural network model is less than the preset error rate threshold, output the neural network model as the local recognition model.
[0041] Figure 2 The structure diagram of the AI-based behavior control system is shown. In a preferred embodiment of the technical solution of the present invention, an AI-based behavior control system is further provided. The system 10 includes: A main body feature extraction module 11, configured to obtain a main body image at the entrance of the area, recognize the main body image to determine the main body area, and synchronously extract the main body features; A main body tracking module 12, configured to insert the main body features into the area feature library, and based on the area feature library, track the area video in real time to determine the main body movement trajectory; the acquisition accuracy of the area video is the preset first accuracy; The AI target recognition module 13 is used to locate abnormal subjects according to the subject movement trajectory, collect close-up videos of abnormal subjects based on the second accuracy, and recognize the close-up videos based on AI; the first accuracy is a constant, the second accuracy is a variable, and the second accuracy is related to the positioning result and the recognition result. The local model training module 14 is used to record the close-up videos recognized by AI and their recognition results, and train the local recognition model; the local recognition model is a neural network model.
[0042] Furthermore, the subject feature extraction module 11 includes: The entrance image acquisition unit is used to install a camera with a temperature measurement module at the entrance of the area, and the camera obtains the entrance image containing temperature information in real time. The area positioning unit is used to locate the subject area in the entrance image based on the temperature information. The pixel point marking unit is used to traverse the subject area, calculate the horizontal gradient and vertical gradient of each pixel point in the subject area, and mark the pixel point when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition. The contour construction unit is used to count the marked pixel points to obtain the subject contour, and construct the subject feature according to the subject contour.
[0043] Specifically, the subject tracking module 12 includes: The feature insertion unit is used to insert the subject feature into the area feature library. The video frame selection unit is used to read the area video and select video frames in the area video according to the preset time step. The position determination unit is used to sequentially read the subject features in the area feature library, traverse the selected video frames, and determine the subject position corresponding to the subject feature. The center point calculation unit is used to count all the subject positions of the same subject feature according to the time sequence of the video frames, and calculate the center point of the subject position. The fitting unit is used to obtain the area map, select mapping points in the area map based on the center point, synchronously determine the color value, and fit all the mapping points to obtain the subject movement trajectory corresponding to the subject feature. Wherein, when the subject position traversed by the subject feature in the area feature library is empty, the time step is reduced. When the reduced time step is less than the preset step threshold and the duration when the traversed subject position is empty is greater than the preset duration threshold, the subject feature is deleted from the area feature library.
[0044] Even further, the AI target recognition module 13 includes: The retrospective time receiving unit is used to receive the retrospective time determined by the staff. A trajectory acquisition unit, configured to acquire all subject movement trajectories within the backtracking time based on a regional map; A pixel point clustering unit, configured to perform pixel point clustering on the regional map containing the subject movement trajectories to obtain sub-regions; An average value calculation unit, configured to calculate the average pixel color value within each sub-region and determine the region to be analyzed according to the average pixel color value; An average value application unit, configured to determine the magnification factor according to the average pixel color value, obtain a close-up video within the region to be analyzed based on the magnification factor, and perform recognition on the close-up video based on AI; A recursive adjustment unit, configured to recursively adjust the magnification factor according to the AI recognition result.
[0045] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. An AI-based behavior control method, characterized in that, The method includes: Obtaining a main body image at the entrance of the area, identifying the main body image to determine the main body area, and synchronously extracting main body features; Inserting the main body features into the area feature library, and based on the area feature library, tracking the area video in real time to determine the main body movement trajectory; the acquisition accuracy of the area video is a preset first accuracy; Locating an abnormal main body according to the main body movement trajectory, collecting a close-up video of the abnormal main body based on a second accuracy, and identifying the close-up video based on AI; the first accuracy is a constant, the second accuracy is a variable, and the second accuracy is related to the positioning result and the identification result; Recording the close-up video identified by AI and its identification result, and training a local identification model; the local identification model is a neural network model.
2. The AI-based behavior control method according to claim 1, wherein The steps of obtaining a main body image at the entrance of the area, identifying the main body image to determine the main body area, and synchronously extracting main body features include: Installing a camera with a temperature measurement module at the entrance of the area, and the camera obtains an entrance image containing temperature information in real time; Locating the main body area in the entrance image based on the temperature information; Traversing the main body area, calculating the horizontal gradient and vertical gradient of each pixel point in the main body area, and when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition, marking the pixel point; Counting the marked pixel points to obtain the main body contour, and constructing main body features according to the main body contour.
3. The AI-based behavior control method according to claim 2, wherein, The steps of counting the marked pixel points to obtain the main body contour and constructing main body features according to the main body contour include: Counting the marked pixel points to obtain the main body contour; Extracting the layers of the internal area of the main body contour in different channels, traversing the pixel points in each layer, recording the values of the pixel points, and constructing an array; the traversal order of the pixel points in all layers is the same; For each array, calculating the independent value of each numerical value in sequence; the independent value is used to represent the degree of difference between each numerical value and other numerical values in the array; Accumulating the independent values, and when the independent value reaches the preset value, marking the corresponding serial number; Screening the serial numbers, and using the screened serial numbers as the main body features.
4. The AI-based behavior control method according to claim 1, wherein The steps of inserting the main body features into the area feature library, and based on the area feature library, tracking the area video in real time to determine the main body movement trajectory include: Inserting the main body features into the area feature library; Reading the area video, and selecting video frames in the area video according to a preset time step; Sequentially reading the main body features in the area feature library, traversing the selected video frames, and determining the main body position corresponding to the main body feature; Statistically calculating the central point of the main body position according to the time sequence of the video frames for all main body positions of the same main body feature; Obtaining the area map, selecting a mapping point in the area map based on the central point, synchronously determining the color value, and fitting all the mapping points to obtain the main body movement trajectory corresponding to the main body feature; Wherein, when the main body position traversed by the main body feature in the area feature library is empty, reducing the time step, and when the reduced time step is less than the preset step threshold and the duration of the empty main body position traversed is greater than the preset duration threshold, deleting the main body feature in the area feature library.
5. The AI-based behavior control method according to claim 1, wherein, The step of locating the abnormal subject according to the subject motion trajectory, collecting the close-range video of the abnormal subject based on the second precision, and identifying the close-range video based on AI includes: Receiving the backtracking time determined by the staff; Obtaining all subject motion trajectories within the backtracking time based on the area map; Performing pixel clustering on the area map containing the subject motion trajectory to obtain sub-areas; Calculating the average pixel color value within each sub-area, and determining the area to be analyzed according to the average pixel color value; Determining the magnification factor according to the average pixel color value, obtaining the close-range video within the area to be analyzed based on the magnification factor, and identifying the close-range video based on AI; Recursively adjusting the magnification factor according to the AI recognition result.
6. The AI-based behavior control method according to claim 5, wherein The step of recording the close-range video identified by AI and its recognition result, and training the local recognition model includes: Recording the close-range video identified by AI and its recognition result; Performing feature extraction on the close-range video to obtain video features; Constructing a sample set from the video features to the recognition result, and training the neural network model; When the error rate of the neural network model is less than the preset error rate threshold, outputting the neural network model as the local recognition model.
7. An AI-based behavior control system, characterized in that, The system includes: A subject feature extraction module, configured to obtain a subject image at the area entrance, identify the subject image to determine the subject area, and synchronously extract subject features; A subject tracking module, configured to insert the subject features into the area feature library, and perform real-time tracking on the area video based on the area feature library to determine the subject motion trajectory; the acquisition precision of the area video is the preset first precision; An AI target recognition module, configured to locate the abnormal subject according to the subject motion trajectory, collect the close-range video of the abnormal subject based on the second precision, and identify the close-range video based on AI; the first precision is a constant, the second precision is a variable, and the second precision is related to the positioning result and the recognition result; A local model training module, configured to record the close-range video identified by AI and its recognition result, and train the local recognition model; the local recognition model is a neural network model.
8. The AI-based behavior control system according to claim 7, wherein The subject feature extraction module includes: An entrance image acquisition unit, configured to install a camera with a temperature measurement module at the area entrance, and the camera obtains the entrance image containing temperature information in real time; An area positioning unit, configured to locate the subject area in the entrance image based on the temperature information; A pixel point marking unit, configured to traverse the subject area, calculate the horizontal gradient and vertical gradient of each pixel point in the subject area, and mark the pixel point when the horizontal gradient and vertical gradient of a certain pixel point meet the preset gradient condition; A contour construction unit, configured to count the marked pixel points to obtain the subject contour, and construct the subject features according to the subject contour.
9. The AI-based behavior control system according to claim 8, wherein The subject tracking module includes: A feature insertion unit, configured to insert the subject features into the area feature library; A video frame selection unit, configured to read the area video and select video frames in the area video according to the preset time step; A position determination unit, configured to sequentially read the subject features in the area feature library, traverse the selected video frames, and determine the subject position corresponding to the subject feature; A center point calculation unit, configured to statistically calculate all subject positions of the same subject feature according to the time sequence of video frames, and calculate the center point of the subject positions; A fitting unit, configured to obtain a regional map, select mapping points in the regional map based on the center point, synchronously determine color values, and fit all mapping points to obtain the subject motion trajectory corresponding to the subject feature; Wherein, when the subject position traversed by the subject feature in the regional feature library is empty, the time step is reduced. When the reduced time step is less than a preset step threshold and the duration of the empty subject position traversed is greater than a preset duration threshold, the subject feature is deleted from the regional feature library.
10. The AI-based behavior control system according to claim 9, wherein The AI target recognition module includes: A retrospective time receiving unit, configured to receive the retrospective time determined by the staff; A trajectory obtaining unit, configured to obtain all subject motion trajectories within the retrospective time based on the regional map; A pixel point clustering unit, configured to perform pixel point clustering on the regional map containing the subject motion trajectory to obtain sub-regions; An average value calculation unit, configured to calculate the average pixel color value in each sub-region, and determine the region to be analyzed according to the average pixel color value; An average value application unit, configured to determine the magnification factor according to the average pixel color value, obtain a close-up video within the region to be analyzed based on the magnification factor, and perform recognition on the close-up video based on AI; A recursive adjustment unit, configured to recursively adjust the magnification factor according to the AI recognition result.
Citation Information
Patent Citations
Abnormal behavior identification method and system in swimming scene and storage medium
CN115797832A
Voice model optimization method and device, equipment and medium
CN117079645A
Park security and protection method and system based on image recognition
CN119888620A
Cross-video person location tracking method and system, and device
WO2021196294A1