Pedestrian abnormal behavior detection method, device and storage medium based on clustering algorithm

The clustering algorithm is used to process pedestrian posture vectors, which solves the problem of poor pedestrian abnormal behavior detection accuracy in different scenarios, achieves high-accuracy detection in scenarios with many normal behaviors and few abnormal behaviors, and improves the effectiveness of pedestrian abnormal behavior detection. .

CN114565784BActive Publication Date: 2024-08-23PING AN TECH (SHENZHEN) CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202210255171.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2024-08-23
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

When detecting abnormal behaviors of pedestrians, it is difficult for the existing technology to accurately identify abnormal behaviors in different scenarios. Especially in scenarios with many normal behaviors and few abnormal behaviors, the detection accuracy is low.

Method used

A method based on a clustering algorithm is used to extract the pedestrian image data through a pre-trained posture extraction network model, generate a pedestrian posture vector, and determine the abnormal pedestrian posture vector through clustering iterative processing, without setting behavior detection standards or labeling abnormal behaviors. .

Benefits of technology

It improves the accuracy of pedestrian abnormal behavior detection, has good scene applicability, and can conveniently and effectively detect abnormal behaviors in pedestrian image data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565784B
    Figure CN114565784B
Patent Text Reader

Abstract

The present application relates to artificial intelligence technology, and provides a method and device, electronic device and storage medium for detecting abnormal behavior of pedestrians based on a clustering algorithm. The method includes: obtaining a pedestrian image data set including multiple pedestrian image data; performing posture extraction on the pedestrian image data set based on a pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each pedestrian image data; performing clustering iteration processing based on the pedestrian posture vectors corresponding to each pedestrian image data until an iteration end condition is met; and determining the pedestrian posture behavior corresponding to the pedestrian posture vectors other than the second pedestrian posture vector group as abnormal behavior. In the embodiment of the present application, there is no need to mark which action types belong to abnormal behavior. By using a clustering algorithm, relatively isolated pedestrian posture vectors without clustering are determined as abnormal pedestrian posture vectors, which can effectively detect abnormal behavior in the pedestrian image data set and improve the accuracy of detecting abnormal pedestrian behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to but are not limited to the field of image processing technology, and in particular to a method and device for detecting abnormal behavior of pedestrians based on a clustering algorithm, an electronic device, and a computer-readable storage medium. Background Art

[0002] Abnormal behavior detection is a field with important application value in computer vision. It is of great significance in public safety protection, family protection of the elderly, etc. By detecting abnormal behavior and alarming through monitoring equipment, abnormal events can be effectively prevented from happening. At present, the research on abnormal behavior of human body is relatively mature, for example, it involves face recognition, pedestrian re-identification, etc. Abnormal behavior detection requires not only identifying pedestrian actions in the monitoring scene, but also determining what actions are abnormal. However, for different scenes, the standards of abnormal behavior may be different, and in quite a few application scenes, there are more normal behaviors and fewer abnormal behaviors, which is not conducive to accurately detecting abnormal behavior of pedestrians. Summary of the invention

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] The embodiments of the present application provide a method and device for detecting abnormal pedestrian behavior based on a clustering algorithm, an electronic device, and a computer-readable storage medium, which can improve the accuracy of detecting abnormal pedestrian behavior.

[0005] In a first aspect, an embodiment of the present application provides a method for detecting abnormal pedestrian behavior based on a clustering algorithm, comprising:

[0006] Acquire a pedestrian image dataset, where the pedestrian image dataset includes a plurality of pedestrian image data;

[0007] Performing posture extraction on the pedestrian image data set based on a pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each of the pedestrian image data, each of the pedestrian posture vectors corresponding to a pedestrian posture behavior;

[0008] Performing clustering iteration processing based on the pedestrian posture vectors corresponding to each of the pedestrian image data until an iteration end condition is met, wherein the clustering iteration processing includes:

[0009] Randomly generate cluster reference vectors;

[0010] For each of the pedestrian posture vectors, calculating the L2 distance between the pedestrian posture vector and the cluster reference vector, and sorting the pedestrian posture vectors according to the L2 distances corresponding to the pedestrian posture vectors to obtain a sorted first pedestrian posture vector group;

[0011] Selecting a portion of the pedestrian posture vectors that are continuously sorted from the first pedestrian posture vector group to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group;

[0012] The iteration termination condition is that the center vector currently obtained is the same as the center vector obtained last time;

[0013] The pedestrian posture vectors except the second pedestrian posture vector group are taken as abnormal pedestrian posture vectors, and the pedestrian posture behaviors corresponding to the abnormal pedestrian posture vectors are determined as abnormal behaviors.

[0014] The abnormal pedestrian behavior detection method based on the clustering algorithm according to the embodiment provided in the present application has at least the following beneficial effects: by performing posture extraction on the pedestrian image data set to obtain the pedestrian posture vector, the clustering algorithm can be further processed based on the pedestrian posture vector, and according to the clustering algorithm results, it is determined which pedestrian posture vectors are abnormal pedestrian posture vectors corresponding to the abnormal behavior, thereby determining the abnormal behavior in the pedestrian image data set. Therefore, there is no need to set any behavior detection standard, nor is there any need to mark which action types belong to abnormal behavior. Only by inputting the pedestrian image data can the abnormal behavior therein be detected. It has good scene applicability, especially when used in scenes with more normal behaviors and fewer abnormal behaviors, the relatively isolated pedestrian posture vectors without clustering are determined as abnormal pedestrian posture vectors through the clustering algorithm, which can more conveniently and effectively detect abnormal behaviors in the pedestrian image data set and improve the accuracy of detecting abnormal pedestrian behavior.

[0015] According to some embodiments of the present application, performing posture extraction on the pedestrian image dataset based on the pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each of the pedestrian image data includes:

[0016] For each of the pedestrian image data in the pedestrian image data set, extract multiple key points from the pedestrian image data by using a pre-trained posture extraction network model, and respectively record the two-dimensional coordinates of each of the key points;

[0017] The two-dimensional coordinates of each of the key points are mapped to obtain a pedestrian posture vector output by the posture extraction network model.

[0018] By extracting multiple key points from pedestrian image data, the body parts, body postures, etc. corresponding to each pedestrian's posture behavior can be determined respectively, and the obtained key points are represented by two-dimensional coordinates, so that the multiple key points can be mapped and processed to obtain the corresponding pedestrian posture vectors, so that the pedestrian posture behavior can be represented by the pedestrian posture vector, so as to further determine the abnormal behavior of the pedestrian based on the pedestrian posture vector.

[0019] According to some embodiments of the present application, the mapping process is performed on the two-dimensional coordinates of each of the key points to obtain the pedestrian posture vector output by the posture extraction network model, including:

[0020] The two-dimensional coordinates of each of the key points are combined in a preset order to obtain an N-dimensional pedestrian posture vector output by the posture extraction network model, wherein the dimension N of the pedestrian posture vector is the number of the key points multiplied by two, and N is an even number greater than 2.

[0021] By combining the two-dimensional coordinates of multiple key points, a spliced ​​N-dimensional pedestrian posture vector can be obtained. The N-dimensional pedestrian posture vector includes the two-dimensional coordinates of each key point in the corresponding pedestrian posture behavior. Therefore, based on the obtained N-dimensional pedestrian posture vector, the details of the pedestrian posture behavior can be well characterized. It can also be proved that processing the N-dimensional pedestrian posture vector is equivalent to further confirming the pedestrian posture behavior.

[0022] According to some embodiments of the present application, the randomly generating a cluster reference vector includes:

[0023] An N-dimensional clustering reference vector is randomly generated, and a value of the clustering reference vector is randomly initialized.

[0024] By randomly generating a cluster reference vector with the same dimension as the pedestrian posture vector, it can be ensured that the pedestrian posture vector and the cluster reference vector can match during calculation and processing, and by randomly initializing the value of the cluster reference vector, it can be ensured that the generated cluster reference vector is universal and indifferent. The abnormal behavior identification results obtained based on this are more authentic, which is conducive to reducing possible errors in identifying abnormal behavior.

[0025] According to some embodiments of the present application, sorting the pedestrian posture vectors according to the L2 distance corresponding to each of the pedestrian posture vectors includes:

[0026] The pedestrian posture vectors are sorted in order of the L2 distances from small to large.

[0027] By sorting the L2 distances from small to large, pedestrian posture vectors in similar parts can be distinguished in similar areas, that is, the pedestrian posture vectors in the sorted continuous parts are distinguished in similar categories, so as to further determine the sequence of pedestrian posture vectors corresponding to abnormal behaviors.

[0028] According to some embodiments of the present application, selecting a portion of the continuously ordered pedestrian posture vectors from the first pedestrian posture vector group to form a second pedestrian posture vector group includes:

[0029] Starting from the first pedestrian gesture vector of the first pedestrian gesture vector group, a portion of the continuously ordered pedestrian gesture vectors are selected according to a preset ratio to form a second pedestrian gesture vector group.

[0030] By selecting the pedestrian posture vectors to be sorted starting from the first pedestrian posture vector of the first pedestrian posture vector group, a second pedestrian posture vector group that meets the requirements can be obtained in sequence from the beginning.

[0031] According to some embodiments of the present application, obtaining a center vector according to the second pedestrian posture vector group includes:

[0032] Calculating an average value of all the pedestrian posture vectors in the second pedestrian posture vector group;

[0033] The center vector is determined according to the average value of all the pedestrian posture vectors.

[0034] By calculating the vector mean of all pedestrian posture vectors in the second pedestrian posture vector group, the position and size of the average center point of all pedestrian posture vectors can be determined, and then the center vector can be accurately and reliably determined based on this.

[0035] In a second aspect, the embodiment of the present application further provides a pedestrian abnormal behavior detection device based on a clustering algorithm, comprising:

[0036] A first processing module is used to obtain a pedestrian image data set, where the pedestrian image data set includes a plurality of pedestrian image data;

[0037] A second processing module is used to perform posture extraction on the pedestrian image data set based on a pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each pedestrian image data, each of which corresponds to a pedestrian posture behavior;

[0038] The third processing module is used to perform clustering iterative processing based on the pedestrian posture vectors corresponding to each of the pedestrian image data until an iteration end condition is met, wherein the clustering iterative processing includes:

[0039] Randomly generate cluster reference vectors;

[0040] For each of the pedestrian posture vectors, calculating the L2 distance between the pedestrian posture vector and the cluster reference vector, and sorting the pedestrian posture vectors according to the L2 distances corresponding to the pedestrian posture vectors to obtain a sorted first pedestrian posture vector group;

[0041] Selecting a portion of the pedestrian posture vectors that are continuously sorted from the first pedestrian posture vector group according to a preset ratio to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group;

[0042] The iteration termination condition is that the center vector currently calculated is the same as the center vector calculated last time;

[0043] The fourth processing module is used to take the pedestrian posture vectors except the second pedestrian posture vector group as abnormal pedestrian posture vectors, and determine the pedestrian posture behaviors corresponding to each of the abnormal pedestrian posture vectors as abnormal behaviors.

[0044] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting abnormal pedestrian behavior based on a clustering algorithm as described in the first aspect above is implemented.

[0045] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the pedestrian abnormal behavior detection method based on clustering algorithm as described in the first aspect above.

[0046] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0048] Figure 1 is a flow chart of a method for detecting abnormal pedestrian behavior based on a clustering algorithm provided by an embodiment of the present application;

[0049] Figure 2This is a flowchart of performing posture extraction on a pedestrian image data set in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0050] Figure 3 It is a flowchart of mapping the two-dimensional coordinates of each key point in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0051] Figure 4 It is a flow chart of clustering iteration processing in a pedestrian abnormal behavior detection method based on a clustering algorithm provided in an embodiment of the present application;

[0052] Figure 5 It is a flowchart of randomly generating cluster reference vectors in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0053] Figure 6 This is a flow chart of sorting the posture vectors of each pedestrian in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0054] Figure 7 It is a flow chart of constituting a second pedestrian posture vector group in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0055] Figure 8 It is a flow chart of obtaining a center vector according to a second pedestrian posture vector group in a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0056] Fig. 9 is an execution flow chart of a pedestrian abnormal behavior detection method based on a clustering algorithm provided by an embodiment of the present application;

[0057] Fig.10 is a schematic diagram of a pedestrian abnormal behavior detection device based on a clustering algorithm provided by an embodiment of the present application;

[0058] Fig.11 It is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0061] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0062] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0063] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0064] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0065] The servers involved in artificial intelligence technology can be independent servers or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0066] The present application provides a method and device for detecting abnormal behavior of pedestrians based on a clustering algorithm, an electronic device and a computer-readable storage medium. The method obtains pedestrian posture vectors by performing posture extraction on a pedestrian image data set, and can further perform clustering algorithm processing based on the pedestrian posture vectors, and determine which pedestrian posture vectors are abnormal pedestrian posture vectors corresponding to abnormal behavior based on the clustering algorithm results, thereby determining the abnormal behavior in the pedestrian image data set. Therefore, there is no need to set any behavior detection standards, nor is there any need to mark which action types belong to abnormal behavior. Only by inputting pedestrian image data can the abnormal behavior therein be detected. The method has good scene applicability, especially when used in scenes with more normal behaviors and fewer abnormal behaviors. The relatively isolated pedestrian posture vectors without clustering are determined as abnormal pedestrian posture vectors through a clustering algorithm, which can more conveniently and effectively detect abnormal behavior in the pedestrian image data set and improve the accuracy of detecting abnormal pedestrian behavior.

[0067] The abnormal behavior detection method for pedestrians based on clustering algorithms provided in the embodiments of the present application relates to the field of artificial intelligence technology. The abnormal behavior detection method for pedestrians based on clustering algorithms provided in the embodiments of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the abnormal behavior detection method for pedestrians based on clustering algorithms, etc., but is not limited to the above forms.

[0068] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0069] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0070] like Figure 1 As shown, Figure 1 This is a flowchart of a method for detecting abnormal pedestrian behavior based on a clustering algorithm provided by an embodiment of the present application. The method for detecting abnormal pedestrian behavior based on a clustering algorithm includes but is not limited to steps S100 to S400.

[0071] Step S100: acquiring a pedestrian image dataset, where the pedestrian image dataset includes a plurality of pedestrian image data.

[0072] In one embodiment, the pedestrian image data set can be obtained after collecting and aggregating a part of the pedestrian image data. For example, it can be a surveillance image of an intersection over a period of time. Different segments of image data can be extracted from the continuous surveillance image, which can be used as pedestrian image data. Furthermore, it is set to collect pedestrian image data from 6 to 8 pm during the peak period, and this part of the data can be aggregated to obtain the pedestrian image data set. It can be understood that in addition to the scene of intersection monitoring, technical personnel in this field can choose a way to obtain a pedestrian image data set according to the actual application scenario, such as a fixed scene that needs to analyze certain behaviors, etc., which is not limited in the present embodiment.

[0073] Step S200, performing posture extraction on a pedestrian image data set based on a pre-trained posture extraction network model to obtain a pedestrian posture vector corresponding to each pedestrian image data, wherein each pedestrian posture vector corresponds to a pedestrian posture behavior.

[0074] In one embodiment, a posture extraction network model is used to extract postures from a pedestrian image dataset, and a pedestrian posture vector corresponding to the pedestrian posture behavior can be obtained, that is, the pedestrian posture behavior can be visualized, so that in subsequent steps, the pedestrian posture vector can be further processed to realize the identification of abnormal pedestrians. In particular, each pedestrian posture vector corresponds to a pedestrian posture behavior, so different pedestrian posture behaviors can be visualized separately, and the abnormal behaviors finally determined therefrom will not be missed, which can meet the requirements of abnormal behavior detection. It can be understood that the purpose of extracting postures from the pedestrian image dataset is to avoid interference with abnormal behavior detection due to irrelevant information such as lighting, angle, size, and clothing, appearance, and facial features of pedestrians in the pedestrian image data set in subsequent calculations, and only retain the pedestrian posture that is a decisive factor for abnormal behavior detection for subsequent calculations, which has better calculation effects.

[0075] It should be noted that there can be multiple types of posture extraction network models, which can be adaptively selected and set in specific application scenarios. For example, it can be a network extraction model based on the open source project of OpenPose, etc., which is not limited in this embodiment.

[0076] exist Figure 2 In the example, step S200 includes but is not limited to steps S210 to S220.

[0077] Step S210, for each pedestrian image data in the pedestrian image data set, extract multiple key points from the pedestrian image data through a pre-trained posture extraction network model, and record the two-dimensional coordinates of each key point respectively;

[0078] Step S220, mapping the two-dimensional coordinates of each key point to obtain the pedestrian posture vector output by the posture extraction network model.

[0079] In one embodiment, by extracting multiple key points from pedestrian image data, the body parts, body postures, etc. corresponding to each pedestrian's posture behavior can be determined respectively, and the obtained key points are represented by two-dimensional coordinates, so that the multiple key points can be mapped and processed to obtain the corresponding pedestrian posture vectors, so that the pedestrian posture behavior can be represented by the pedestrian posture vector, so as to further determine the abnormal behavior of the pedestrian based on the pedestrian posture vector.

[0080] exist Figure 3 In the example, step S220 includes but is not limited to step S221.

[0081] Step S221, combining the two-dimensional coordinates of each key point in a preset order to obtain an N-dimensional pedestrian posture vector output by the posture extraction network model, wherein the dimension N of the pedestrian posture vector is the number of key points multiplied by two, and N is an even number greater than 2.

[0082] In one embodiment, by combining the two-dimensional coordinates of each key point, the key points can be linked to each other to form an N-dimensional pedestrian posture vector. In this case, the content information of all key points can be represented by only one N-dimensional pedestrian posture vector, and there is no need to calculate or process the content information of the key points separately. This is conducive to more convenient processing of pedestrian image data based on clustering algorithms, reducing the overall calculation difficulty and improving detection efficiency.

[0083] It should be noted that the preset order can be set according to the actual scenario, and is usually only considered when the order has an impact on the calculation, that is, if the order of the combination is not a major influence, the order can be set according to the situation, which is not limited in this embodiment.

[0084] The following is a specific example to illustrate the working principle and process of the above embodiment.

[0085] Example 1:

[0086] If a pedestrian's posture behavior has 4 key points extracted, corresponding to the 4 body parts of the arm, neck, back and left foot, and the two-dimensional coordinates are (X1, Y1), (X2, Y2), (X3, Y3) and (X4, Y4) respectively, and they are set to be combined in the order of neck, left foot, arm and back, then the pedestrian posture vector finally obtained by the output of the posture extraction network model is (X2, Y2, X4, Y4, X1, Y1, X3, Y3), and the dimension of the pedestrian posture vector is 8 = the number of key points 4*the dimension of key points 2.

[0087] Step S300, performing clustering iteration processing based on the pedestrian posture vectors corresponding to each pedestrian image data until the iteration end condition is met, wherein Figure 4 In the example, the clustering iteration process includes:

[0088] Step S310, randomly generating a cluster reference vector;

[0089] Step S320, for each pedestrian posture vector, calculating the L2 distance between the pedestrian posture vector and the cluster reference vector, and sorting the pedestrian posture vectors according to the L2 distances corresponding to the pedestrian posture vectors to obtain a sorted first pedestrian posture vector group;

[0090] Step S330, selecting a portion of continuously ordered pedestrian posture vectors from the first pedestrian posture vector group to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group;

[0091] The iteration termination condition is that the currently obtained center vector is the same as the last obtained center vector.

[0092] In one embodiment, a clustering algorithm is iteratively processed to obtain a calculation result that meets the iteration requirements, wherein the iteration is performed in a manner of randomly generating cluster reference vectors, which can minimize the randomness of the calculation results, and the second pedestrian posture vector group is further determined from the first pedestrian posture vector group by calculating the L2 distance, so that cluster vectors and non-cluster vectors can be distinguished from each pedestrian posture vector, which is conducive to further confirming abnormal behavior based on this.

[0093] It is understandable that since the calculation method of L2 distance is well known to those skilled in the art, it will not be elaborated here, and calculating L2 distance is not the only way to sort the pedestrian posture vectors. For example, sorting can also be performed by comparing the sizes of the pedestrian posture vectors and other types of sorting, which is not limited in this embodiment.

[0094] It can be understood that the purpose of setting the iteration end condition that the currently obtained center vector is the same as the center vector obtained last time is to strengthen the influence of the clustering effect and weaken the influence of the clustering reference vector, that is, to prove that the properties of each pedestrian posture vector in the first pedestrian posture vector group selected are similar, so that the result shown in the iteration end condition can be obtained.

[0095] exist Figure 5 In the example, step S310 includes but is not limited to step S311.

[0096] Step S311: randomly generate an N-dimensional clustering reference vector, and randomly initialize the value of the clustering reference vector.

[0097] In one embodiment, by randomly generating a cluster reference vector with the same dimension as the pedestrian posture vector, it can be ensured that the pedestrian posture vector and the cluster reference vector can match during calculation and processing, and by randomly initializing the value of the cluster reference vector, it can be ensured that the generated cluster reference vector is universal and has no difference. The abnormal behavior identification results obtained based on this have better authenticity, which is conducive to reducing possible errors in identifying abnormal behavior.

[0098] It can be understood that since the dimensions of the clustering reference vector and the pedestrian posture vector are the same, the two can be used in the clustering analysis to perform relevant calculations without distinction, and the calculation results obtained are direct, true and effective, without the need for conversion, which is conducive to improving the accuracy of the clustering algorithm.

[0099] exist Figure 6 In the example, "sorting each pedestrian posture vector according to the L2 distance corresponding to each pedestrian posture vector" in step S320 includes but is not limited to step S321.

[0100] Step S321, sorting the pedestrian posture vectors in order of their L2 distances from small to large.

[0101] In one embodiment, by sorting the L2 distances from small to large, pedestrian posture vectors of similar parts can be distinguished in similar smaller areas, that is, the pedestrian posture vectors in the sorted continuous parts are distinguished in similar smaller categories, so as to further determine the sequence of pedestrian posture vectors corresponding to abnormal behavior; it can be understood that, similarly, each L2 distance can be sorted from large to small, and the pedestrian posture vectors of similar parts can also be distinguished in similar larger areas, that is, the pedestrian posture vectors in the sorted continuous parts are distinguished in similar larger categories, so as to further determine the sequence of pedestrian posture vectors corresponding to abnormal behavior.

[0102] exist Figure 7 In the example, "selecting a portion of continuously sorted pedestrian posture vectors from the first pedestrian posture vector group to form a second pedestrian posture vector group" in step S330 includes but is not limited to step S331.

[0103] Step S331 , starting from the first pedestrian gesture vector of the first pedestrian gesture vector group, a portion of continuously ordered pedestrian gesture vectors are selected according to a preset ratio to form a second pedestrian gesture vector group.

[0104] In one embodiment, by selecting the pedestrian posture vector to be sorted starting from the first pedestrian posture vector of the first pedestrian posture vector group, a second pedestrian posture vector group that meets the requirements can be obtained in sequence from the beginning. Since the L2 distances corresponding to the continuously sorted pedestrian posture vectors are also sorted continuously, the category features of this part of the continuously sorted pedestrian posture vectors are obviously similar. Therefore, the properties of the second pedestrian posture vector group composed of them are unified, so that accurate calculation results can be obtained by performing clustering algorithm operations based on them.

[0105] In one embodiment, the preset ratio may be set according to an actual application scenario, which is not limited in this embodiment.

[0106] exist Figure 8In the example, "obtaining a center vector according to the second pedestrian posture vector group" in step S330 includes but is not limited to steps S332 to S333.

[0107] Step S332, calculating the average value of all pedestrian posture vectors in the second pedestrian posture vector group;

[0108] Step S333, determining the center vector according to the average value of all pedestrian posture vectors.

[0109] In one embodiment, a clustering algorithm is iteratively processed to obtain a calculation result that meets the iteration requirements, wherein the iteration is performed in a manner of randomly generating cluster reference vectors, which can minimize the randomness of the calculation results, and the second pedestrian posture vector group is further determined from the first pedestrian posture vector group by calculating the L2 distance, so that cluster vectors and non-cluster vectors can be distinguished from each pedestrian posture vector, which is conducive to further confirming abnormal behavior based on this.

[0110] The following examples are given to illustrate the working principles and processes of the above embodiments.

[0111] Example 2:

[0112] If five pedestrian posture vectors (denoted as Q1, Q2, Q3, Q4, and Q5) are finally extracted from a pedestrian image dataset, the L2 distance between each pedestrian posture vector and the pre-generated cluster reference vector L is calculated respectively, and the five values ​​of A1, A2, A3, A4, and A5 are obtained correspondingly, and A3 is greater than A1 and less than A2, A2 is less than A4, and A4 is less than A5. Then the L2 distance is sorted from small to large as A3, A1, A2, A4, and A5. Then the pedestrian posture vectors corresponding to each L2 distance are sorted in this order, i.e., Q3, Q1, Q2, Q4, and Q5. Then the first three consecutively sorted pedestrian posture vectors Q3, Q1, and Q2 are taken to form the second pedestrian posture vector group, and the center vector corresponding to the second pedestrian posture vector group is determined.

[0113] Step S400: The pedestrian posture vectors other than the second pedestrian posture vector group are taken as abnormal pedestrian posture vectors, and the pedestrian posture behaviors corresponding to the abnormal pedestrian posture vectors are determined as abnormal behaviors.

[0114] In one embodiment, pedestrian posture vectors are obtained by performing posture extraction on a pedestrian image data set, and clustering algorithm processing can be further performed based on the pedestrian posture vectors. According to the clustering algorithm results, it is determined which pedestrian posture vectors are abnormal pedestrian posture vectors corresponding to abnormal behaviors, thereby determining the abnormal behaviors in the pedestrian image data set. Therefore, there is no need to set arbitrary behavior detection standards, nor is there a need to mark which action types belong to abnormal behaviors. Only the input of pedestrian image data is required to detect the abnormal behaviors therein. The method has good scene applicability, especially when used in scenes with more normal behaviors and fewer abnormal behaviors. Relatively isolated pedestrian posture vectors without clustering are determined as abnormal pedestrian posture vectors through a clustering algorithm, which can more conveniently and effectively detect abnormal behaviors in pedestrian image data sets and improve the accuracy of detecting abnormal pedestrian behaviors.

[0115] Specific examples are given below to illustrate the working principles and processes of the above embodiments.

[0116] Example 3:

[0117] like Fig. 9 As shown, Fig. 9 This is an execution flow chart of a method for detecting abnormal pedestrian behavior based on a clustering algorithm provided in one embodiment of the present application.

[0118] exist Fig. 9 In the example, the following process is executed:

[0119] Firstly, a pedestrian image dataset is collected and input into a pedestrian posture extraction network, which then outputs a pedestrian posture vector.

[0120] Then, a clustering algorithm is used to perform clustering iterative calculation on multiple pedestrian posture vectors, and the calculation results are output, wherein the clustering iterative calculation includes: randomly generating a clustering reference vector; for each pedestrian posture vector, calculating the L2 distance between the pedestrian posture vector and the clustering reference vector, and sorting the pedestrian posture vectors according to the L2 distances corresponding to the pedestrian posture vectors to obtain a sorted first pedestrian posture vector group; according to a preset ratio, a part of continuously sorted pedestrian posture vectors is selected from the first pedestrian posture vector group to form a second pedestrian posture vector group, and a center vector is obtained according to the second pedestrian posture vector group; the iteration end condition is that the center vector currently calculated is the same as the center vector calculated last time.

[0121] Finally, the clustering results are analyzed to determine the corresponding pedestrian posture vectors of the above-mentioned clustering iteration calculation as cluster points, which are identified as vectors corresponding to normal behavior, and the remaining pedestrian posture vectors are identified as isolated points, which are identified as vectors corresponding to abnormal behavior.

[0122] It can be seen from the above examples that the entire process does not require labeling of which behavior is normal or abnormal, but through the distinction between clustering and isolation to determine the isolated points that are not clustered, or the isolated points that lack similar actions. This unsupervised pedestrian abnormal behavior detection method can take advantage of the situation of "more normal behaviors and fewer abnormal behaviors" that is difficult to solve in related technologies. This is also the technical problem that the embodiments of the present application are actually intended to solve, so that the obtained detection results are more targeted and more accurate.

[0123] In addition, if Fig.10 As shown, an embodiment of the present application further provides a pedestrian abnormal behavior detection device based on a clustering algorithm, comprising:

[0124] The first processing module 100 is used to obtain a pedestrian image dataset, where the pedestrian image dataset includes a plurality of pedestrian image data;

[0125] The second processing module 200 is used to extract the posture of the pedestrian image data set based on the pre-trained posture extraction network model to obtain the pedestrian posture vector corresponding to each pedestrian image data, and each pedestrian posture vector corresponds to a pedestrian posture behavior;

[0126] The third processing module 300 is used to perform clustering iteration processing based on the pedestrian posture vectors corresponding to each pedestrian image data until the iteration end condition is met, wherein the clustering iteration processing includes:

[0127] Randomly generate cluster reference vectors;

[0128] For each pedestrian posture vector, the L2 distance between the pedestrian posture vector and the cluster reference vector is calculated, and the pedestrian posture vectors are sorted according to the L2 distances corresponding to the pedestrian posture vectors to obtain a sorted first pedestrian posture vector group;

[0129] Selecting a portion of continuously ordered pedestrian posture vectors from the first pedestrian posture vector group according to a preset ratio to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group;

[0130] The iteration ends when the center vector currently calculated is the same as the center vector calculated last time.

[0131] The fourth processing module 400 is used to take the pedestrian posture vectors other than the second pedestrian posture vector group as abnormal pedestrian posture vectors, and determine the pedestrian posture behaviors corresponding to the abnormal pedestrian posture vectors as abnormal behaviors.

[0132] In one embodiment, the second processing module 200 performs posture extraction on the pedestrian image data set to obtain the pedestrian posture vector, and the third processing module 300 can further perform clustering algorithm processing on the pedestrian posture vector, and the fourth processing module 400 determines which pedestrian posture vectors are abnormal pedestrian posture vectors corresponding to abnormal behaviors according to the clustering algorithm results, thereby determining the abnormal behaviors in the pedestrian image data set. Therefore, there is no need to set any behavior detection standards, nor to mark which action types belong to abnormal behaviors. Only by inputting the pedestrian image data can the abnormal behaviors therein be detected. The method has good scene applicability, especially when used in scenes with more normal behaviors and fewer abnormal behaviors. The relatively isolated pedestrian posture vectors without clustering are determined as abnormal pedestrian posture vectors through the clustering algorithm, which can more conveniently and effectively detect abnormal behaviors in the pedestrian image data set and improve the accuracy of detecting abnormal pedestrian behaviors.

[0133] In addition, if Fig.11 As shown, an embodiment of the present application further provides an electronic device 500 , which includes: a memory 510 , a processor 520 , and a computer program stored in the memory 510 and executable on the processor 520 .

[0134] The processor 520 and the memory 510 may be connected via a bus or other means.

[0135] The non-transient software program and instructions required to implement the above-mentioned method for detecting abnormal pedestrian behavior based on a clustering algorithm are stored in the memory 510. When executed by the processor 520, the above-mentioned method for detecting abnormal pedestrian behavior based on a clustering algorithm is executed. For example, the above-mentioned method for detecting abnormal pedestrian behavior based on a clustering algorithm is executed. Figure 1 The method steps S100 to S400, Figure 2 Steps S210 to S220 of the method, Figure 3 Step S221 of the method, Figure 4 Steps S310 to S330 of the method, Figure 5 Step S311 of the method, Figure 6 Step S321 of the method, Figure 7 Method step S331 or Figure 8 Method steps S332 to S333 in.

[0136] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0137] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions, which are executed by a processor 520 or a controller, for example, by a processor 520 in the above-mentioned device embodiment, so that the processor 520 can execute the pedestrian abnormal behavior detection method based on the clustering algorithm in the above-mentioned embodiment, for example, execute the above-mentioned Figure 1 The method steps S100 to S400, Figure 2 Steps S210 to S220 of the method, Figure 3 Step S221 of the method, Figure 4 Steps S310 to S330 of the method, Figure 5 Step S311 of the method, Figure 6 Step S321 of the method, Figure 7 Method step S331 or Figure 8 Method steps S332 to S333 in.

[0138] The above embodiments may be used in combination, and modules with the same name in different embodiments may be the same or different.

[0139] The above describes specific embodiments of the present application, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0140] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0141] The apparatus, device, computer-readable storage medium and method provided in the embodiments of the present application correspond to each other. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be repeated here.

[0142] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using hardware entity modules.

[0143] For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used when writing program development. The original code before compilation must also be written in a specific programming language, which is called Hardware Description Language (HDL). There is not only one type of HDL, but many types, such as:

[0144] ABEL (Advanced Boolean Expression Language); AHDL (Altera HardwareDescription Language); Confluence; CUPL (Cornell University Programming Language); HDCal; and

[0145] JHDL (Java Hardware Description Language); Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc.;

[0146] At present, in the field of technology, VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog are more commonly used. Those skilled in the art should also know that by programming the method flow in the above-mentioned hardware description languages ​​and programming it into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0147] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers:

[0148] ARC 625D, Atmel AT91SAM, MicrochIP address PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code, it is entirely possible to implement the same function in the form of a logic gate, a switch, an ASIC, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0149] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0150] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0151] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0152] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0156] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0157] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0158] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0159] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0160] Embodiments of the present application may be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. Embodiments of the present application may also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0161] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0162] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for detecting abnormal pedestrian behavior based on clustering algorithm, characterized in that: include: Acquire a pedestrian image dataset, where the pedestrian image dataset includes a plurality of pedestrian image data; Performing posture extraction on the pedestrian image data set based on a pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each of the pedestrian image data, each of the pedestrian posture vectors corresponds to a pedestrian posture behavior, each of the pedestrian posture behaviors belongs to a normal behavior or an abnormal behavior, and the number of normal behaviors in the pedestrian image data set is greater than the number of abnormal behaviors; Performing clustering iteration processing based on the pedestrian posture vectors corresponding to each of the pedestrian image data until an iteration end condition is met, wherein the clustering iteration processing includes: Randomly generate a cluster reference vector having the same dimension as the pedestrian posture vector; For each of the pedestrian posture vectors, calculating the L2 distance between the pedestrian posture vector and the cluster reference vector, and sorting the pedestrian posture vectors in order of the L2 distances from small to large to obtain a sorted first pedestrian posture vector group; Starting from the first pedestrian posture vector of the first pedestrian posture vector group, selecting the pedestrian posture vectors that are continuously sorted according to a preset ratio to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group; The iteration termination condition is that the center vector currently obtained is the same as the center vector obtained last time; The pedestrian posture vectors except the second pedestrian posture vector group are used as abnormal pedestrian posture vectors, and the pedestrian posture behaviors corresponding to the abnormal pedestrian posture vectors are determined as the abnormal behaviors.

2. The method for detecting abnormal pedestrian behavior based on clustering algorithm according to claim 1, characterized in that: The pre-trained posture extraction network model is used to extract the posture of the pedestrian image data set to obtain the pedestrian posture vector corresponding to each pedestrian image data, including: For each of the pedestrian image data in the pedestrian image data set, extract multiple key points from the pedestrian image data by using a pre-trained posture extraction network model, and respectively record the two-dimensional coordinates of each of the key points; The two-dimensional coordinates of each of the key points are mapped to obtain a pedestrian posture vector output by the posture extraction network model.

3. The method for detecting abnormal pedestrian behavior based on clustering algorithm according to claim 2, characterized in that: The mapping process is performed on the two-dimensional coordinates of each of the key points to obtain the pedestrian posture vector output by the posture extraction network model, including: The two-dimensional coordinates of each of the key points are combined in a preset order to obtain an N-dimensional pedestrian posture vector output by the posture extraction network model, wherein the dimension N of the pedestrian posture vector is the number of the key points multiplied by two, and N is an even number greater than 2.

4. The method for detecting abnormal pedestrian behavior based on clustering algorithm according to claim 3 is characterized in that: The randomly generating a cluster reference vector having the same dimension as the pedestrian posture vector comprises: An N-dimensional clustering reference vector is randomly generated, and a value of the clustering reference vector is randomly initialized.

5. The method for detecting abnormal pedestrian behavior based on clustering algorithm according to claim 1, characterized in that: The obtaining of the center vector according to the second pedestrian posture vector group includes: Calculating an average value of all the pedestrian posture vectors in the second pedestrian posture vector group; The center vector is determined according to the average value of all the pedestrian posture vectors.

6. A pedestrian abnormal behavior detection device based on clustering algorithm, characterized in that: include: A first processing module is used to obtain a pedestrian image data set, where the pedestrian image data set includes a plurality of pedestrian image data; A second processing module is used to perform posture extraction on the pedestrian image data set based on a pre-trained posture extraction network model to obtain pedestrian posture vectors corresponding to each of the pedestrian image data, each of the pedestrian posture vectors corresponds to a pedestrian posture behavior, each of the pedestrian posture behaviors belongs to a normal behavior or an abnormal behavior, and the number of normal behaviors in the pedestrian image data set is greater than the number of abnormal behaviors; The third processing module is used to perform clustering iterative processing based on the pedestrian posture vectors corresponding to each of the pedestrian image data until an iteration end condition is met, wherein the clustering iterative processing includes: Randomly generate a cluster reference vector having the same dimension as the pedestrian posture vector; For each of the pedestrian posture vectors, calculating the L2 distance between the pedestrian posture vector and the cluster reference vector, and sorting the pedestrian posture vectors in ascending order of the L2 distances to obtain a sorted first pedestrian posture vector group; Starting from the first pedestrian posture vector of the first pedestrian posture vector group, selecting the pedestrian posture vectors that are continuously sorted according to a preset ratio to form a second pedestrian posture vector group, and obtaining a center vector according to the second pedestrian posture vector group; The iteration termination condition is that the center vector currently calculated is the same as the center vector calculated last time; The fourth processing module is used to take the pedestrian posture vectors except the second pedestrian posture vector group as abnormal pedestrian posture vectors, and determine the pedestrian posture behaviors corresponding to each of the abnormal pedestrian posture vectors as abnormal behaviors.

7. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting abnormal pedestrian behavior based on a clustering algorithm as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the pedestrian abnormal behavior detection method based on clustering algorithm as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Bicycle user abnormal behavior detection method

    CN109784253A

  • Method for automatically identifying human body action abnormity from monitoring video

    CN111062356A

  • Public place abnormal behavior automatic identification method and device, and camera equipment

    CN112085003A

  • Abnormal behavior recognition method and device, electronic equipment and storage medium

    CN112200081A

  • Model training method, human body posture detection method and device, equipment and medium

    CN112307940A