Abnormal behavior identification method and device
By storing text description features and video description features of abnormal behavior locally on the client, combined with the target abnormal behavior selected by the user, the flexibility and accuracy of abnormal behavior recognition are achieved, solving the problem of poor recognition flexibility of existing models and reducing The need for retraining.
Patent Information
- Application Number
- CN202410599635.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-05-13
AI Technical Summary
Existing abnormal behavior recognition models can only identify specific abnormal behaviors and cannot flexibly identify new abnormal behaviors, resulting in poor recognition flexibility, requiring retraining of the model, and complicated processes.
The text description features of abnormal behavior are stored locally on the client. The user can select the target abnormal behavior to be identified, and identify whether the target has abnormal target behavior through the similarity between the video description feature and the text description feature. A list of multiple abnormal behaviors is supported for the user. Choice, flexibility.
The flexibility of abnormal behavior identification is improved. Users can select target abnormal behaviors according to their needs, which reduces the frequency and complexity of model training and improves identification accuracy.
Smart Images

Figure CN118172837B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for identifying abnormal behavior. Background Art
[0002] Nowadays, the coverage rate of surveillance cameras is getting higher and higher. By performing object behavior recognition on the videos collected by surveillance cameras, abnormal behaviors of objects in the videos can be discovered, so that subsequent responses can be made in a timely manner, which is conducive to ensuring the safety and order of various places.
[0003] In the related art, an abnormal behavior recognition model is usually pre-trained for a specific one or several abnormal behaviors. The trained abnormal behavior recognition model is only effective for the above-mentioned specific abnormal behaviors, that is, it can only recognize the above-mentioned specific abnormal behaviors. In this way, when using the above-mentioned abnormal behavior recognition model for abnormal behavior recognition, it can only recognize whether the object in the video has the above-mentioned specific abnormal behavior, and the abnormal behavior that can be recognized cannot be changed.
[0004] However, in actual scenarios, the abnormal behaviors that need to be identified often change. When it is necessary to identify new abnormal behaviors other than the above-mentioned specific abnormal behaviors, since the original model cannot identify the new abnormal behaviors, it is necessary to retrain the model that can identify the new abnormal behaviors, that is, it is necessary to re-execute the model training steps. The process is relatively complicated, resulting in poor flexibility in abnormal behavior identification. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method and device for identifying abnormal behavior to improve the flexibility in identifying abnormal behavior. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for identifying abnormal behavior, which is applied to a client, and the method includes:
[0007] Locally storing text description features of each abnormal behavior in the abnormal behavior set, wherein the text description features include: multiple local features of the description text of the abnormal behavior;
[0008] Based on the selection operation of the user in the list of each abnormal behavior, configuring the target abnormal behavior to be identified;
[0009] In response to obtaining a video of abnormal behavior to be identified, a video description feature of an object in the video is obtained, and based on the similarity between the locally stored text description feature and the video description feature, whether the object exhibits the target abnormal behavior is identified, wherein the video description feature includes: multiple local features of the object determined based on multiple video frames of the video.
[0010] In a second aspect, an embodiment of the present application provides a method for identifying abnormal behavior, the method comprising:
[0011] Get the description text of abnormal behavior;
[0012] Performing feature extraction on the obtained description text to obtain text description features of the abnormal behavior, wherein the text description features include: multiple local features of the obtained description text;
[0013] The obtained text description features are updated to the text description feature library;
[0014] Based on the text description feature library, text description features are provided to the client, so that the client can identify whether an object in the video has abnormal behavior based on the obtained text description features.
[0015] In a third aspect, an embodiment of the present application provides an abnormal behavior identification device, which is applied to a client, and the device includes:
[0016] A feature storage module, used to locally store text description features of each abnormal behavior in the abnormal behavior set, wherein the text description features include: multiple local features of the description text of the abnormal behavior;
[0017] An abnormal behavior configuration module, used to configure a target abnormal behavior to be identified based on a selection operation by a user in the list of abnormal behaviors;
[0018] An abnormal behavior identification module is used to obtain a video of an abnormal behavior to be identified in response to obtaining the video description features of an object in the video, and identify whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features, wherein the video description features include: multiple local features of the object determined based on multiple video frames of the video.
[0019] In a fourth aspect, an embodiment of the present application provides an abnormal behavior identification device, which is applied to a server, and the device includes:
[0020] A description text acquisition module is used to obtain a description text of abnormal behavior;
[0021] A text description feature acquisition module is used to extract features from the obtained description text to obtain text description features of the abnormal behavior, wherein the text description features include: multiple local features of the obtained description text;
[0022] A second text description feature updating module, used for updating the obtained text description features to a text description feature library;
[0023] The text description feature providing module is used to provide text description features to the client based on the text description feature library, so that the client can identify whether an object in the video has abnormal behavior based on the obtained text description features.
[0024] In a fifth aspect, an embodiment of the present application provides a client, including:
[0025] Memory, used to store computer programs;
[0026] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0027] In a sixth aspect, an embodiment of the present application provides a server, including:
[0028] Memory, used to store computer programs;
[0029] The processor is used to implement the method described in the second aspect when executing the program stored in the memory.
[0030] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0031] In an eighth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first or second aspect above.
[0032] As can be seen from the above, when the solution provided by the embodiment of the present application is used to identify abnormal behaviors, the client provides a list of multiple abnormal behaviors for the user to choose from, so that the user can flexibly select the target abnormal behavior to be identified from the above list according to actual needs. In other words, the target abnormal behavior to be identified is not fixed, but is optional and can be flexibly changed, which can meet the different definitions of abnormal behavior for different users. The user can also change the selected target abnormal behavior as the identification needs change, which improves the flexibility in identifying abnormal behaviors.
[0033] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0035] Figure 1 A flowchart of a first abnormal behavior identification method provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of a first abnormal behavior list provided in an embodiment of the present application;
[0037] Figure 3 A flowchart of a second abnormal behavior identification method provided in an embodiment of the present application;
[0038] Figure 4 A flowchart of a third abnormal behavior identification method provided in an embodiment of the present application;
[0039] Figure 5 A signaling diagram of the first abnormal behavior identification process provided in an embodiment of the present application;
[0040] Figure 6 A signaling diagram of the second abnormal behavior identification process provided in an embodiment of the present application;
[0041] Figure 7a A schematic diagram of the first behavior adding interface provided in an embodiment of the present application;
[0042] Figure 7b A schematic diagram of a second behavior adding interface provided in an embodiment of the present application;
[0043] Figure 7c A schematic diagram of a second abnormal behavior list provided in an embodiment of the present application;
[0044] Figure 8 A signaling diagram of the third abnormal behavior identification process provided in an embodiment of the present application;
[0045] Figure 9a A schematic diagram of a first recognition result feedback interface provided in an embodiment of the present application;
[0046] Figure 9b A schematic diagram of a second recognition result feedback interface provided in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of a neural network model provided in an embodiment of the present application;
[0048] Fig.11 A schematic diagram of an abnormal behavior identification system provided in an embodiment of the present application;
[0049] Fig.12 A schematic diagram of the structure of a first abnormal behavior identification device provided in an embodiment of the present application;
[0050] Fig.13A schematic diagram of the structure of a second abnormal behavior identification device provided in an embodiment of the present application;
[0051] Fig.14 A schematic diagram of the structure of a client provided in an embodiment of the present application;
[0052] Fig.15 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0054] First, some concepts involved in the solutions provided in the embodiments of the present application are introduced.
[0055] 1. Abnormal behavior
[0056] Abnormal behavior is a concept relative to normal behavior, and refers to behavior that does not comply with relevant regulations and requirements in certain scenarios / places.
[0057] It should be noted that the abnormal behavior involved in the solution provided in the embodiment of the present application is not limited to abnormal behavior of humans, but can also be abnormal behavior of animals, equipment, etc.
[0058] For example, in public places such as hospitals, abnormal behavior may be fighting, smoking, etc.; in scenarios where people are queuing up to buy tickets, abnormal behavior may be people cutting in line, etc.; in zoos, abnormal behavior may be animals falling into a coma, etc.; on production lines, abnormal behavior may be equipment failure, etc.
[0059] It can be seen that abnormal behaviors are closely related to specific scenarios / places, and different scenarios / places may correspond to different abnormal behaviors.
[0060] In the solution provided in the embodiment of the present application, the client can display a list of various abnormal behaviors to the user, so that the user can flexibly select the abnormal behaviors that need to be detected in the actual scenario from the list according to the needs of the actual scenario. See the subsequent embodiments for details, which will not be described in detail here.
[0061] 2. Description of abnormal behavior
[0062] The above description text may be a text describing the abnormal behavior from various angles.
[0063] Specifically, it may be a text describing the characteristics of abnormal behavior, or it may be a text describing the characteristics that abnormal behavior does not have.
[0064] For example, for the abnormal behavior of a person being unconscious, the above description text can be a text describing the characteristics of the abnormal behavior, such as "the person is lying on the ground, motionless", "the person is on all fours", etc.; it can also be a text describing the characteristics that the abnormal behavior does not have, such as "the person is not standing", "the person is not moving".
[0065] The abnormal behavior identification method provided by the embodiment of the present invention is described in detail below through specific examples.
[0066] See also Figure 1 , which is a flow chart of the first abnormal behavior identification method provided in an embodiment of the present application. The above method is applied to the client and includes the following steps S101-S104.
[0067] Step S101: storing text description features of each abnormal behavior in the abnormal behavior set locally.
[0068] The abnormal behaviors included in the abnormal behavior set may be set by the staff based on experience.
[0069] In one case, the staff can set the abnormal behaviors in the abnormal behavior set according to the requirements for abnormal behavior identification in various common scenarios / places, so that the abnormal behaviors included in the abnormal behavior set can meet the requirements of more scenarios / places.
[0070] The above-mentioned text description features include: multiple local features of the description text of the abnormal behavior.
[0071] The above local features are concepts relative to overall features. Local features are not overall features, but features of certain parts of the whole, which can also be called fine-grained features. The method of extracting local features is detailed in the subsequent method embodiment applied to the server, which will not be described in detail here.
[0072] The following describes how the client obtains text description features of abnormal behavior.
[0073] In one case, the textual description feature of the abnormal behavior may be provided by the server.
[0074] The server may maintain a text description feature library, which stores text description features of abnormal behaviors, so that the server can provide text description features to the client based on the text description feature library. For details, please refer to the subsequent application and server embodiments, which will not be described in detail here.
[0075] In another case, the text description features of the abnormal behavior can be obtained through storage media such as a disk or a hard disk.
[0076] Specifically, the staff may connect a storage medium such as a disk or a hard disk storing text description features of abnormal behaviors to the client, and copy the text description features stored in the storage medium to the storage space of the client.
[0077] Step S102: Based on the user's selection operation in the list of various abnormal behaviors, configure the target abnormal behavior to be identified.
[0078] In this step, the client can display a list of various abnormal behaviors to the user, so that the user can flexibly select the abnormal behaviors that need to be detected in the actual scenario from the list according to the needs of the actual scenario, and then the client can configure the abnormal behaviors selected by the user as the target abnormal behaviors to be identified.
[0079] The above list may be a list of all abnormal behaviors in the abnormal behavior set, or may be a list of some abnormal behaviors in the abnormal behavior set.
[0080] The abnormal behaviors selected by the user may be one or more.
[0081] See also Figure 2 , which is a schematic diagram of an abnormal behavior list provided in an embodiment of the present application.
[0082] Figure 2 The abnormal behavior list shown includes all abnormal behaviors in the abnormal behavior set, such as smoking, fighting, crowding, coma, falling, carrying prohibited items, etc. After the client displays the above abnormal behavior list, the user can browse all abnormal behaviors in the abnormal behavior set, so that the abnormal behavior to be detected can be selected according to actual needs. For example, if the user selects the two abnormal behaviors of smoking and coma, the client can configure the two abnormal behaviors of smoking and coma as target abnormal behaviors to be identified.
[0083] In response to obtaining the video of the abnormal behavior to be identified, the client may execute steps S103 and S104.
[0084] The following describes a method for obtaining videos of abnormal behaviors to be identified.
[0085] In one case, the client can establish a communication connection with the surveillance camera, so that the surveillance camera can transmit the collected video to the client in real time in the form of a video stream. The client decodes the obtained video stream to obtain the video of the abnormal behavior to be identified.
[0086] In another case, the client can obtain videos of abnormal behaviors to be identified sent by other electronic devices.
[0087] In another case, the video of the abnormal behavior to be identified may also be obtained through storage media such as a disk or a hard disk.
[0088] Step S103: Obtain video description features of objects in the video.
[0089] The video description features of an object in a video include: multiple local features of the object determined based on multiple video frames of the video, that is, features determined based on multiple images. The above multiple images can be called an image sequence, and thus, the video description features of the object can also be called the image sequence features of the object.
[0090] Similarly, the above-mentioned local features are concepts relative to overall features. Local features are not overall features, but features of certain parts of the whole, which can also be called fine-grained features.
[0091] Among them, from the dimension of feature extraction, the multiple local features of an object can be understood as features obtained through fine-grained feature extraction methods; from the dimension of the object, the multiple local features of an object can be understood as features corresponding to various parts of the object.
[0092] This application does not limit the method of obtaining multiple local features of the above-mentioned object, and an example is given below.
[0093] In one case, multiple local features of the object in the video may be obtained based on the association between multiple video frames of the video.
[0094] In this case, multiple local features of the object in the video may be obtained in the following manner.
[0095] In a first approach, multiple video frames included in the above video may be input into a pre-trained video feature extraction model to obtain multiple local features of objects in the video output by the video feature extraction model.
[0096] The video feature extraction model extracts features from video frames, analyzes fine-grained differences in objects between multiple video frames based on the extracted features, and obtains multiple local features of objects in the video based on the analysis results.
[0097] The embodiments of the present application do not limit the architecture, training method, etc. of the above-mentioned video feature extraction model.
[0098] For example, the video feature extraction model may be a convolutional neural network model, which may perform multi-layer convolution processing on the input video frames through multi-layer convolution layers, and extract the features of the video frames based on the processing results.
[0099] The second method is to use image feature extraction algorithms such as SIFT (Scale-invariant feature transform) algorithm, LBP algorithm (Local Binary Patterns) algorithm, HOG (Histogram of Oriented Gradient) algorithm to extract image features of objects in multiple video frames respectively, determine the features corresponding to each part of the object in the extracted image features, calculate the feature differences between each object part of the object in each video frame, and obtain multiple local features of the object in the above video according to the obtained feature differences.
[0100] Step S104: Based on the similarity between the locally stored text description features and the video description features, identify whether the object has target abnormal behavior.
[0101] After steps S101 to S103, the client has locally stored the text description features of each abnormal behavior, configured the target abnormal behavior to be identified, and obtained the video description features of the object in the video. In this way, when the client obtains the video of the abnormal behavior to be identified, it can identify whether the object in the video exhibits the target abnormal behavior based on the similarity between the above text description features and the video description features.
[0102] The above text description features are local features of the description text of the abnormal behavior, and the video description features are local features of the object in the video. The similarity between the text description features and the video description features reflects the probability that the above object will exhibit the abnormal behavior described in the description text.
[0103] The following is an introduction to the specific method of identifying whether an object exhibits target abnormal behavior.
[0104] In a first implementation manner, the following steps may be used to identify whether the object exhibits target abnormal behavior.
[0105] Step A: Calculate the first similarity between each local feature in the locally stored text description feature and each local feature in the video description feature.
[0106] In one case, the text description features involved in similarity calculation may be all text description features stored locally;
[0107] In another case, the text description features involved in similarity calculation may be text description features corresponding to the target abnormal behavior among all text description features.
[0108] When the client locally stores text description features of abnormal behavior, it can also establish a correspondence between each abnormal behavior identifier and the text description feature. In this case, the client can determine the text description feature corresponding to the target abnormal behavior from all the text description features stored locally based on the above correspondence.
[0109] For example, if the target abnormal behavior is "a person smoking", the client can determine the text description features corresponding to the abnormal behavior of "a person smoking" from all the text description features stored locally.
[0110] The first similarity is the similarity between each local feature in the text description feature and each local feature in the video description feature, that is, for each local feature in the text description feature, the similarity between the local feature and each local feature in the video description feature is calculated. The first similarity can be described by the Euclidean distance, cosine distance, etc. between the features, which will not be repeated here.
[0111] Step B: Taking the text description feature as a unit, adopting the self-attention mechanism, weighted summing up the first similarities corresponding to the locally stored text description features, and obtaining the similarity between the locally stored text description features and the video description features.
[0112] Specifically, self-attention processing can be performed on the local features included in the text description features, and based on the processing results, an importance representation value of each local feature relative to the text description feature is obtained. Then, the above-mentioned importance representation value is used to perform weighted summation on the first similarities corresponding to each local feature, and based on the summation result, the similarity between the text description feature and the video description feature is obtained.
[0113] For example, the local features included in the text description feature F1 are [f1, f2, f3], the local features included in the video description feature F2 are [f4, f5], the first similarities between f1-f3 and f4 are s1-s3 respectively, and the importance representation values corresponding to f1-f3 are w1-w3 respectively. Then, w1-w3 can be used to perform weighted summation of s1-s3, that is, calculate w1×s1+w2×s2+w3×s3. The same method can be used to obtain the result of weighted summation of the first similarity between f1-f3 and f5. Then, the sum, average, etc. of the obtained summation results can be used as the similarity between the text description feature F1 and the video description feature F2.
[0114] Step C: Based on the obtained similarity, determine whether the object exhibits the target abnormal behavior.
[0115] In one case, if there is a similarity greater than a preset similarity threshold among the obtained similarities, it can be determined that the object has the target abnormal behavior, otherwise, it is determined that the object has not the target abnormal behavior.
[0116] In another case, the overall representation value of the obtained similarity can be calculated, and whether the object has the target abnormal behavior can be determined based on the overall representation value. The above overall representation value can be the average value, median value, etc. of the obtained similarity.
[0117] It can be seen that the first similarity is the similarity between each local feature in the text description feature and each local feature in the video description feature, which can describe the relationship between the text description feature and the video description feature in a fine-grained manner. By using the self-attention mechanism, the weighted sum of the first similarities corresponding to the text description features can be further reduced. The information loss in the similarity calculation process can be further improved, and the accuracy of judging whether the object has the target abnormal behavior based on the obtained similarity is further improved.
[0118] In a second implementation, the similarity between the first average feature of the text description feature and the second average feature of the video description feature can be calculated as the similarity between the text description feature and the video description feature, and then based on the obtained similarity, it is identified whether the object has a target abnormal behavior.
[0119] The first average feature is the average feature of each local feature included in the text description feature, and the second average feature is the average feature of each local feature included in the video description feature.
[0120] The method of identifying whether the object has the target abnormal behavior based on the obtained similarity has been introduced in the previous implementation mode and will not be repeated here.
[0121] In a third embodiment, the locally stored text description features and video description features can be input into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model. The abnormal behavior recognition result characterizes whether the object has the target abnormal behavior, such as the confidence level that the object has the target abnormal behavior. The architecture and training method of the abnormal behavior recognition model are described in detail in the subsequent embodiments and will not be described in detail here.
[0122] In this way, through the pre-trained abnormal behavior recognition model, it is possible to quickly and accurately identify whether the object exhibits the target abnormal behavior.
[0123] As can be seen from the above, when applying the solution provided by the embodiment of the present application to identify abnormal behaviors, the client can locally store the text description features of each abnormal behavior in the abnormal behavior set, and then configure the target abnormal behavior to be identified based on the user's selection operation in the list of each abnormal behavior. Thus, in response to obtaining a video of the abnormal behavior to be identified, the client can obtain the video description features of the object in the video of the video, and identify whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0124] It can be seen that in the solution provided by the embodiment of the present application, the client provides a list of multiple abnormal behaviors for the user to choose from, so that the user can flexibly select the target abnormal behavior to be identified from the above list according to actual needs. In other words, the target abnormal behavior to be identified is not fixed, but is optional and can be flexibly changed, which can meet the different definitions of abnormal behavior for different users. The user can also change the selected target abnormal behavior as the identification needs change, which improves the flexibility in identifying abnormal behavior.
[0125] In addition, the text description features of abnormal behavior include multiple local features of the description text of the abnormal behavior, and the video description features of the object include multiple local features of the object. Compared with the overall features, the local features are fine-grained features that can reflect the characteristics of the text and the object in a more fine-grained manner, and can also more comprehensively capture the characteristic expression information of the text and the object. Therefore, when identifying whether the object has the target abnormal behavior based on the above-mentioned text description features and object description features, it can reduce information loss, which is conducive to accurately identifying fine-grained abnormal behaviors and improving the accuracy of abnormal behavior identification results.
[0126] In one embodiment of the present application, if the client detects that an object in the video has abnormal target behavior, alarm information of the abnormal target behavior may be displayed on the user interface.
[0127] The above-mentioned alarm information may include the type of target abnormal behavior, the time period when the target abnormal behavior occurs, the video frame number when the target abnormal behavior occurs, etc.
[0128] exist Figure 1 Based on the illustrated embodiment, in some cases, when identifying whether an object has a target abnormal behavior, in addition to considering the text description features and the video description features of the video, the audio description features of the video may also be considered. In view of the above situation, the embodiment of the present application provides another abnormal behavior identification method.
[0129] See also Figure 3 , is a flow chart of a second abnormal behavior identification method provided in an embodiment of the present application. The above method is applied to a client and includes the following steps S301-S305.
[0130] Step S301: storing text description features of each abnormal behavior in the abnormal behavior set locally.
[0131] Step S302: Based on the selection operation of the user in the list of each abnormal behavior, configure the target abnormal behavior to be identified.
[0132] The above steps S301-S302 are the same as the above steps Figure 1In the illustrated embodiment, steps S101 and S102 are the same and will not be described in detail here.
[0133] In response to obtaining the video of the abnormal behavior to be identified, the client may execute steps S303 to S305.
[0134] Step S303: Obtain video description features of objects in the video.
[0135] The method of obtaining the video description features of the object has been described in the aforementioned step S103 and will not be repeated here.
[0136] Step S304: extract the audio in the video and obtain audio description features of the audio.
[0137] The above audio description features include: multiple local features of the audio.
[0138] Similarly, the above-mentioned local features are concepts relative to overall features. Local features are not overall features, but features of certain parts of the whole, which can also be called fine-grained features.
[0139] This application does not limit the method of obtaining the above-mentioned multiple local features of the audio, which is briefly described below.
[0140] For example, the above description text can be input into a pre-trained audio feature extraction model to obtain multiple local features of the audio output by the audio feature extraction model; or the audio can be divided first to obtain audio units, and then features are extracted from each audio unit to obtain local features of the audio.
[0141] Step S305: Based on the similarity between each two types of features in the locally stored text description features, the obtained audio description features, and the video description features, identify whether the object has a target abnormal behavior.
[0142] The following is an introduction to the specific method of identifying whether an object exhibits target abnormal behavior.
[0143] In a first implementation manner, the following steps may be used to identify whether the object exhibits target abnormal behavior.
[0144] Step D: Calculate the first similarity between each local feature in the locally stored text description feature and each local feature in the video description feature, calculate the second similarity between each local feature in the locally stored text description feature and each local feature in the obtained audio description feature, and calculate the third similarity between each local feature in the video description feature and each local feature in the obtained audio description feature.
[0145] and Figure 1Similar to the illustrated embodiment, the text description features involved in the similarity calculation may be all text description features stored locally, or may be text description features corresponding to the target abnormal behavior in all text description features. The first similarity, the second similarity and the third similarity may be described by Euclidean distance, cosine distance, etc. between the features, which will not be repeated here.
[0146] Step E: Using the self-attention mechanism, weighted summation is performed on the first similarities corresponding to the locally stored text description features to obtain the first overall similarity between the locally stored text description features and the video description features, and weighted summation is performed on the second similarities corresponding to the locally stored text description features to obtain the second overall similarity between the locally stored text description features and the video description features, and weighted summation is performed on the third similarities corresponding to the video description features to obtain the third overall similarity between the video description features and the obtained audio description features.
[0147] The calculation method of the first overall similarity is described in the above Figure 1 This is described in step S104 of the illustrated embodiment and will not be described again here.
[0148] The calculation method of the second overall similarity and the third overall similarity is similar to the calculation method of the first overall similarity, and a brief description is given below taking the second overall similarity as an example.
[0149] Specifically, the importance representation value of each local feature included in the text description feature relative to the text description feature can be used to perform weighted summation on the second similarities corresponding to each local feature, and the similarity between the text description feature and the audio description feature can be obtained based on the summation result.
[0150] For example, the local features included in the text description feature F1 are [f1, f2, f3], the local features included in the audio description feature F3 are [f6, f7], the second similarities between f1-f3 and f6 are s4-s6 respectively, and the importance representation values corresponding to f1-f3 are w1-w3 respectively. Then, w1-w3 can be used to perform weighted summation of s4-s6, that is, calculate w1×s4+w2×s5+w3×s6. The same method can be used to obtain the result of weighted summation of the second similarity between f1-f3 and f7. Then, the sum, average, etc. of the sum results can be used as the similarity between the text description feature F1 and the audio description feature F3.
[0151] Step F: Determine whether the object exhibits target abnormal behavior based on the obtained similarity.
[0152] The embodiment of the present application does not limit the specific method of determining whether the object exhibits target abnormal behavior based on the obtained similarity.
[0153] In one case, the overall representation values of the first overall similarity, the second overall similarity, and the third overall similarity can be calculated, and whether the object has the target abnormal behavior can be determined based on the overall representation values. The above overall representation value can be the average value, median value, etc. of the obtained similarities.
[0154] In a second implementation, the similarity between the first average feature of the text description feature and the second average feature of the video description feature can be calculated as the first overall similarity between the text description feature and the video description feature; the similarity between the first average feature and the third average feature of the audio description feature can be calculated as the second overall similarity between the text description feature and the obtained audio description feature; the similarity between the above-mentioned second average feature and the third average feature can be calculated as the third overall similarity between the text description feature and the audio description feature, and then based on the obtained similarity, whether the object exhibits target abnormal behavior can be identified.
[0155] The method of identifying whether the object has the target abnormal behavior based on the obtained similarity has been introduced in the previous implementation mode and will not be repeated here.
[0156] In a third embodiment, the locally stored text description features, video description features, and the obtained audio description features can be input into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model. The architecture and training method of the above abnormal behavior recognition model are detailed in the subsequent embodiments and will not be described in detail here.
[0157] It can be seen that in this embodiment, when identifying whether an object in a video exhibits target abnormal behavior, in addition to considering the text description features of the abnormal description text and the video description features of the object in the video, the audio description features of the video are also considered. In this way, the modality used to identify abnormal behavior is expanded, and it is possible to more accurately identify whether an object exhibits target abnormal behavior based on the relationship between text, image and audio, thereby further improving the accuracy of the recognition results.
[0158] Corresponding to the above-mentioned abnormal behavior identification method applied to the client, the embodiment of the present application also provides an abnormal behavior identification method applied to the server.
[0159] See also Figure 4 , which is a flow chart of a third abnormal behavior identification method provided in an embodiment of the present application. The above method is applied to a server and includes the following steps S401-S404.
[0160] Step S401: Obtain a description text of the abnormal behavior.
[0161] The description text of the abnormal behavior mentioned above may be input by a staff member or collected from the Internet, and this embodiment of the present application does not limit this.
[0162] Step S402: extracting features from the obtained description text to obtain text description features of the abnormal behavior.
[0163] The text description features include: a plurality of local features of the obtained description text.
[0164] This application does not limit the method of obtaining multiple local features of the above-mentioned description text, and an example is given below.
[0165] In one implementation, the description text may be input into a pre-trained text feature extraction model to obtain a plurality of local features of the description text output by the text feature extraction model.
[0166] The embodiments of the present application do not limit the architecture, training method, etc. of the above-mentioned text feature extraction model.
[0167] In one case, the above-mentioned text feature extraction model can be a convolutional neural network model, which can perform multi-layer convolution processing on the input description text through multiple layers of convolution layers to obtain local features of the description text.
[0168] In another implementation, the description text may be first divided into text units, and then features may be extracted from the obtained text units to obtain a plurality of local features of the description text.
[0169] Among them, text feature extraction algorithms such as Word2Vec (word to vector) algorithm, BERT (Bidirectional Encoder Representations from Transformers) algorithm, TF-IDF (term frequency-inverse document frequency) algorithm, etc. can be used to extract features from the obtained text units, but the embodiments of the present application are not limited to this.
[0170] Step S403: updating the obtained text description features to the text description feature library.
[0171] Step S404: providing text description features to the client based on the text description feature library, so that the client can identify whether the object in the video has abnormal behavior based on the obtained text description features.
[0172] In this step, after the server provides the text description features to the client, the client can store the received text description features locally, and then identify whether the object has target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0173] Among them, the text description features can be provided to the client in the following ways:
[0174] In one implementation, the server may provide all features recorded in the text description feature library to the client.
[0175] In another implementation, when the server stores text description features of abnormal behaviors in a text description feature library, it can also establish a correspondence between each abnormal behavior identifier and the text description feature. In this case, the client can send the abnormal behavior identifier of each abnormal behavior in the abnormal behavior set to the server. The server can determine the text description feature corresponding to the abnormal behavior identifier from all text description features stored in the text description feature library based on the abnormal behavior identifier sent by the client and the above-mentioned correspondence, and provide the determined text description feature to the client.
[0176] As can be seen from the above, in the solution provided by the embodiment of the present application, the server can obtain the description text of the abnormal behavior and extract the text description features of the description text, and update the text description feature library based on the obtained text description features, so that the text description features can be provided to the client based on the text description feature library. It can be seen that the server can continuously update the text description feature library, that is, the server maintains a text description feature library including a large number of text description features. The above text description feature library provides a data basis for the client. Based on the rich text description features provided by the server, the client can identify whether the object in the video of the abnormal behavior to be identified has various abnormal behaviors selected by the user, which improves the flexibility in abnormal behavior identification.
[0177] The following is an intuitive description of the solution provided in the embodiment of the present application from the perspective of information interaction between the client and the server.
[0178] See also Figure 5 , which is a signaling diagram of the first abnormal behavior identification process provided in an embodiment of the present application, and the above process includes the following steps.
[0179] Step S501: The server obtains a description text of the abnormal behavior.
[0180] Step S502: The server performs feature extraction on the obtained description text to obtain text description features of the abnormal behavior.
[0181] Step S503: The server updates the obtained text description features to the text description feature library.
[0182] Step S504: the server provides text description features to the client based on the text description feature library.
[0183] Step S505: The client stores the received text description features locally.
[0184] Step S506: The client configures the target abnormal behavior to be identified based on the user's selection operation in the list of abnormal behaviors.
[0185] Step S507: In response to obtaining the video of the abnormal behavior to be identified, the client obtains the video description features of the object in the video, and identifies whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0186] The specific implementation methods of the above steps have been described in the Figure 1 , Figure 3 , Figure 4 It is explained in the embodiment shown and will not be described again here.
[0187] exist Figure 5 Based on the illustrated embodiment, in some cases, the first abnormal behavior that the user expects to identify may not exist in the list of abnormal behaviors displayed by the client. In this case, the client can obtain the description text entered by the user and feed the description text back to the server. Through the interaction between the client and the server, the list of abnormal behaviors that the client supports identifying is expanded.
[0188] In view of the above situation, the embodiment of the present application provides a second abnormal behavior identification process.
[0189] See also Figure 6 , which is a signaling diagram of the second abnormal behavior identification process provided in an embodiment of the present application, and the above process includes the following steps.
[0190] Step S601: The server obtains a description text of the abnormal behavior.
[0191] Step S602: The server performs feature extraction on the obtained description text to obtain text description features of the abnormal behavior.
[0192] Step S603: The server updates the obtained text description features to the text description feature library.
[0193] Step S604: the server provides text description features to the client based on the text description feature library.
[0194] Step S605: The client stores the received text description features locally.
[0195] Step S606: The client obtains a first description text of the first abnormal behavior input by the user.
[0196] When the first abnormal behavior that the user expects to identify does not exist in the list of abnormal behaviors displayed on the client, the user can trigger a behavior adding function in the interactive interface of the client to input a first description text of the first abnormal behavior.
[0197] See also Figure 7a , which is a schematic diagram of the first behavior adding interface provided in an embodiment of the present application.
[0198] If the first abnormal behavior B1 that the user expects to identify is people cutting in line, it can be seen that Figure 7a The list of abnormal behaviors shown does not include the first abnormal behavior B1, so the user can click the add behavior button on the interface to trigger the behavior adding function. After triggering the above behavior adding function, the client can display Figure 7b The interface shown.
[0199] See also Figure 7b , which is a schematic diagram of the second behavior adding interface provided in an embodiment of the present application.
[0200] In this interface, a prompt text may be displayed to guide the user to input a description text of the abnormal behavior, such as "Please enter the description text of the abnormal behavior to be added in the text box below:", and the user may enter a first description text of the first abnormal behavior B1 in the text box, such as people lining up in a line, people at the back of the line leaving the line and moving to the front of the line, etc. After the user clicks the End Add button, the client may obtain the first description text input by the user.
[0201] Step S607: The client sends a first description text to the server.
[0202] Step S608: The server receives a first description text of the first abnormal behavior sent by the client.
[0203] Step S609: Based on the first description text, the server detects whether there is a text description feature of the first abnormal behavior in the text description feature library.
[0204] Step S610: The server sends a first text description feature of the first abnormal behavior to the client based on the detection result.
[0205] Specifically, if the detection result is existence, the server may directly send the text description feature of the first abnormal behavior stored in the text description feature library to the client.
[0206] If the detection result is that it does not exist, the server can generate a text description feature of the first abnormal behavior based on the first description text, send the generated text description feature to the client, and add the generated text description feature to the text description feature library.
[0207] When the server generates a text description feature of the first abnormal behavior based on the first description text:
[0208] In one implementation, the server may directly extract multiple local features of the first description text as text description features of the first abnormal behavior.
[0209] In another implementation, the server may perform text amplification processing on the first description text to obtain an amplified text, and then respectively extract multiple local features of the first description text and the amplified text to obtain text description features of the first abnormal behavior.
[0210] Specifically, the following method may be used to perform text amplification processing on the first description text to obtain an amplified text.
[0211] In one implementation, LLM (Large Language Model) may be used to perform text augmentation processing on the first description text to obtain augmented text.
[0212] Among them, the above-mentioned large-scale language model is an ultra-large deep learning model trained using massive data sets, which can amplify text.
[0213] In another implementation, text replacement or other methods may be used to replace some words in the first description text, and the augmented text is obtained after the replacement.
[0214] In another implementation, some words in the first description text may be further explained to obtain an augmented text.
[0215] In one case, the amplified text may include description text obtained by synonymously amplifying the first description text, may include description text obtained by antisense amplification of the first description text, or may include both description text obtained by synonymously amplifying the first description text and description text obtained by antisense amplification of the first description text.
[0216] In this way, through synonymous amplification and antisense amplification, the first description text can be amplified in both synonymous and antonymic dimensions, so that the obtained amplified text is more distinctive than other texts, and thus the text description features generated based on the first description text and the amplified text are more distinctive than the text description features of other behaviors, which is conducive to improving the accuracy of subsequent identification of abnormal behaviors based on the generated text description features.
[0217] It can be seen that in this embodiment, by performing text amplification processing on the first description text, the data volume of the amplified description text is increased, making the amplified text richer, and then by performing feature extraction on the amplified text, richer text description features of the first abnormal behavior can be obtained, which is beneficial to improving the accuracy of identifying abnormal behaviors based on the obtained text description features.
[0218] It can be seen that after receiving the first description text of the first abnormal behavior sent by the client, the server can send the text description features of the first abnormal behavior to the client. After the client locally stores the first text description features of the first abnormal behavior, it can identify the first abnormal behavior that was originally unrecognizable based on the first text description features, thereby improving the flexibility and scalability of the client in identifying abnormal behavior.
[0219] Step S611: the client receives the first text description feature sent by the server.
[0220] Step S612: The client stores the first text description feature locally and adds the first abnormal behavior to a list.
[0221] See also Figure 7c , which is a schematic diagram of the second abnormal behavior list provided in the embodiment of the present application, it can be seen that, Figure 7c The first abnormal behavior B1 has been added to the abnormal behavior list shown.
[0222] After the user clicks the End Add button, the client can obtain the first description text of the first abnormal behavior B1, so that the client obtains and locally stores the first text description feature of the first abnormal behavior B1 through interaction with the server. In this way, the client can identify the first abnormal behavior B1 based on the similarity between the first text description feature stored locally and the video description feature of the object in the video, that is, the client can support the identification of the first abnormal behavior B1. Therefore, the client can add the first abnormal behavior B1 to the list of abnormal behaviors to facilitate subsequent user selection.
[0223] It can be seen that after the client locally stores the first text description feature of the first abnormal behavior, it can identify the first abnormal behavior that was originally unrecognizable based on the first text description feature, thereby improving the flexibility and scalability of identifying abnormal behavior.
[0224] Step S613: The client configures the target abnormal behavior to be identified based on the user's selection operation in the list of abnormal behaviors.
[0225] Step S614: In response to obtaining the video of the abnormal behavior to be identified, the client obtains the video description features of the object in the video, and identifies whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0226] exist Figure 5 Based on the embodiment shown, the client can also report the text fed back by the user based on the recognition result to the server, so that the server can update the text description feature library. Figure 8 , which is a signaling diagram of the third abnormal behavior identification process provided in an embodiment of the present application, and the above process includes the following steps.
[0227] Step S801: The server obtains a description text of the abnormal behavior.
[0228] Step S802: The server performs feature extraction on the obtained description text to obtain text description features of the abnormal behavior.
[0229] Step S803: The server updates the obtained text description features to the text description feature library.
[0230] Step S804: The server provides text description features to the client based on the text description feature library.
[0231] Step S805: The client stores the received text description features locally.
[0232] Step S806: The client configures the target abnormal behavior to be identified based on the user's selection operation in the list of abnormal behaviors.
[0233] Step S807: In response to obtaining the video of the abnormal behavior to be identified, the client obtains the video description features of the object in the video, and identifies whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0234] Step S808: The client obtains a second description text of the target abnormal behavior reported by the user based on the recognition result of the target abnormal behavior.
[0235] In some cases, the user may find that the recognition result of the target abnormal behavior is wrong or missing in the client. In this case, the user can trigger the recognition result feedback function in the interactive interface of the client to enter a second description text of the target abnormal behavior.
[0236] See also Figure 9a , which is a schematic diagram of the first recognition result feedback interface provided in an embodiment of the present application.
[0237] like Figure 9a As shown, the client's abnormal behavior recognition result for the object in video V1 is:
[0238] The subject in video V1 did not show the target abnormal behavior B2; the subject in video V1 showed the target abnormal behavior B3; …
[0239] If the user believes that there are errors or omissions in the abnormal behavior recognition results after watching video V1, he can click the recognition result feedback button on the interface to trigger the recognition result feedback function. After triggering the above recognition result feedback function, the client can display Figure 9b The interface shown.
[0240] See also Figure 9b , which is a schematic diagram of the second recognition result feedback interface provided in an embodiment of the present application.
[0241] In this interface, a prompt text can be displayed to guide the user to enter a description text of the target abnormal behavior, such as "Please enter the feedback text of the recognition result in the text box below:", the user can enter a second description text of the target abnormal behavior in the text box, and after the user clicks the confirmation feedback button, the client can obtain the second description text entered by the user.
[0242] In one embodiment of the present application, the second description text may include text describing the characteristics of the target abnormal behavior, may include text that the target abnormal behavior does not have characteristics, or may include both text that the target abnormal behavior has characteristics and text that the target abnormal behavior does not have characteristics.
[0243] In this way, the second description text can include texts of two dimensions: whether the target abnormal behavior has the characteristics or not. It has strong distinguishing power, which is conducive to highlighting the difference between the target abnormal behavior and other behaviors, and is conducive to improving the accuracy of identifying the target abnormal behavior based on the text description features of the second description text.
[0244] Step S809: The client sends a second description text to the server.
[0245] In this way, the client can synchronize the second description text reported by the user based on the identification result of the target abnormal behavior to the server in a timely manner, so that the server updates the text description features of the target abnormal behavior recorded in the text description feature library based on the second description text, that is, the text description features included in the text description feature library maintained by the server are richer and more accurate.
[0246] Step S810: The server receives the second description text sent by the client.
[0247] Step S811: The server updates the text description features of the abnormal behavior recorded in the text description feature library in the server based on the second description text.
[0248] It should be noted that the server may execute step S811 when obtaining more second description texts.
[0249] Specifically, when the server updates the text description features recorded in the text description feature library based on the second description text, the server can directly extract multiple local features of the second description text and add the extracted features to the text description feature library; or the server can perform text amplification processing on the second description text to obtain an amplified text, and then respectively extract multiple local features of the second description text and the amplified text, and add the extracted features to the text description feature library.
[0250] In one case, the server may also add the extracted features to the text description features corresponding to the target abnormal behavior in the text description feature library according to the corresponding relationship between the abnormal behavior identifier and the text feature.
[0251] In one embodiment of the present application, the staff may also directly report the description text of the abnormal behavior to the server. The above description text may be the description text fed back by the staff based on the abnormal behavior identification result, or the description text of the abnormal behavior actively collected.
[0252] In one embodiment of the present application, the server can generate an update instruction carrying the text description features based on the text description features updated in the text description feature library, and send the text feature update instruction to the client, so that the client can receive the update instruction for the text description features sent by the server, and update the locally stored text description features based on the text description features carried in the update instruction.
[0253] Specifically, the server may generate the above update instruction when detecting that the text description feature recorded in the text description feature library is updated, or may generate the above update instruction according to a preset update cycle.
[0254] In this way, the client can obtain the updated text description features of the text description feature library of the server in a timely manner, making the locally stored text description features richer and improving the accuracy of the client in identifying abnormal behaviors based on the locally stored text description features.
[0255] For the server, it can send update instructions to the client so that the client can obtain the text description features updated in the text description feature library in a timely manner, making the text description features stored locally on the client richer and improving the accuracy of the client in identifying abnormal behavior based on the locally stored text description features.
[0256] It can be seen that after the server obtains the second description text of the abnormal behavior reported by the user based on the recognition result of the abnormal behavior sent by the client, it can update the text description features of the abnormal behavior recorded in the text description feature library in the server based on the second description text, that is, the text description feature library can be updated in a targeted manner based on the user's feedback on the recognition result. In this way, when the server subsequently updates the text description features to the client, the client can obtain the updated text description features based on the second description text, so that when the client identifies the abnormal behavior based on the updated text description features, it also additionally considers the text description features corresponding to the second description text, making the referenced text description features richer and further improving the accuracy of identifying abnormal behavior.
[0257] The following introduces the training method of the abnormal behavior recognition model mentioned above.
[0258] The first training method can be to train the above abnormal behavior recognition model using the following steps G-I:
[0259] Step G: Obtain sample text description features of the sample abnormal behavior, sample video description features of the sample object in the video frame of the sample video, and identification annotation information characterizing whether the sample object exhibits the sample abnormal behavior.
[0260] The sample text description features include: multiple local features of the description text of the sample abnormal behavior, and the sample video description features include: multiple local features of the sample object determined based on multiple video frames of the sample video.
[0261] The meaning and method of obtaining the local features of the description text of the sample abnormal behavior are similar to those of the description text of the aforementioned abnormal behavior, with the only difference being the text. Similarly, the meaning and method of obtaining the local features of the sample object are similar to those of the local features of the object in the aforementioned video, with the only difference being the object, and they will not be repeated here.
[0262] In one embodiment of the present application, the description text of the sample abnormal behavior includes a third description text of the sample abnormal behavior directly obtained, and a fourth description text obtained by performing text amplification processing on the third description text.
[0263] Specifically, the third description text may be amplified to obtain the fourth description text in the following manner:
[0264] In one implementation, LLM may be used to perform text amplification processing on the third description text to obtain a fourth description text.
[0265] Among them, the above-mentioned large-scale language model is an ultra-large deep learning model trained using massive data sets, which can amplify text.
[0266] In another implementation, text replacement or other methods may be used to replace some words in the third description text to obtain the fourth description text.
[0267] In one case, the fourth description text includes: description text obtained by performing synonymous expansion on the third description text.
[0268] In another case, the fourth description text includes: a description text obtained by performing antisense amplification on the third description text.
[0269] Of course, the fourth description text may also include both description text obtained by performing synonymous amplification on the third description text and description text obtained by performing antisense amplification on the third description text.
[0270] In this way, through synonymous amplification and antisense amplification, the third description text can be amplified in both synonymous and antonymous dimensions, so that the amplified fourth description text is more distinctive than other texts, which is conducive to removing noise and improving the performance of the trained model.
[0271] It can be seen that in this embodiment, by performing text amplification processing on the third description text, the sample data volume of the sample description text is increased, the richness and accuracy of the sample description text are improved, which is conducive to improving the performance of the abnormal behavior recognition model trained based on the sample description text.
[0272] Step H: Input the sample text description features and the sample video description features into a preset neural network model to obtain the sample recognition result output by the neural network model.
[0273] The sample recognition result is generated based on the first sample similarity between the sample text description feature and the sample video description feature, and represents whether the sample object has sample abnormal behavior.
[0274] The calculation method of the first sample similarity is similar to the calculation method of the similarity between the text description feature and the video description feature introduced in the aforementioned step S104. The only difference is the specific parameter values used in the calculation process. Only a brief introduction is given below.
[0275] The first sample similarity is obtained by using the self-attention mechanism to perform a weighted sum of the similarities between each local feature in the sample text description feature and each local feature in the sample video description feature.
[0276] Specifically, self-attention processing can be performed on the local features included in the sample text description features, and based on the processing results, an importance representation value of each local feature relative to the sample text description feature is obtained. Then, the above-mentioned importance representation value is used to perform weighted summation on the similarity between each local feature and each local feature of the sample object to obtain the first sample similarity between the sample text description feature and the sample video description feature.
[0277] Step I: Determine a first loss value of the neural network model according to the sample recognition result and the recognition annotation information, and adjust the model parameters of the neural network model based on the first loss value to obtain an abnormal behavior recognition model.
[0278] Specifically, after adjusting the model parameters of the neural network model based on the first loss value, the process may return to step E until a preset training end condition is met to obtain an abnormal behavior recognition model. The training end condition may be that the first loss value is less than a preset loss value threshold, the number of iterative training rounds reaches a preset number of rounds, etc.
[0279] It can be seen that after the sample text description features of the sample abnormal behavior and the sample video description features of the sample object in the video frame of the sample video are input into the preset neural network model, the model can obtain the recognition result based on the first sample similarity between the sample text description features and the sample video description features. According to the error between the recognition result and the annotation information, the model can learn the association between the sample text description features of the sample abnormal behavior and the sample video description features of the sample object, so as to train a model that can accurately identify whether the object has the abnormal behavior described in the description text.
[0280] It can be seen that by adopting the above training method, the model can learn the association between the text description features and the video description features. In this way, by inputting the text description features and the video description features into the above abnormal behavior recognition model, the abnormal behavior recognition results output by the abnormal behavior recognition model can be obtained.
[0281] On the basis of the first training method, when training the preset neural network model, in addition to considering the two modalities of text description features and video description features, the audio description feature modality can also be considered so that the model can learn the association between multimodal features. In view of the above situation, the embodiment of the present application provides a second training method for the abnormal behavior recognition model.
[0282] The second training method can use the following steps J-L to train the above abnormal behavior recognition model:
[0283] Step J: Obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, sample audio description features of sample audio in sample videos, and identification annotation information characterizing whether sample objects exhibit sample abnormal behavior.
[0284] The sample audio description features include: multiple local features of the sample audio.
[0285] The meaning and acquisition method of the local features of the sample audio are similar to the meaning and acquisition method of the local features of the audio in the video of the abnormal behavior to be identified above. The only difference is the audio, which will not be repeated here.
[0286] Step K: Input the sample text description features, sample video description features and sample audio description features into a preset neural network model to obtain a sample recognition result output by the neural network model.
[0287] The above sample recognition result is generated based on the first sample similarity, the second sample similarity and the third sample similarity.
[0288] The second sample similarity can be obtained by adopting a self-attention mechanism and weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature; the third sample similarity can be obtained by adopting a self-attention mechanism and weighted summing up the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature.
[0289] The calculation method of the above-mentioned second sample similarity is similar to the calculation method of the similarity between the text description feature and the audio description feature introduced in the above-mentioned step S305, and the only difference is that the specific parameter values used in the calculation process are different; similarly, the calculation method of the above-mentioned third sample similarity is similar to the calculation method of the similarity between the video description feature and the audio description feature introduced in the above-mentioned step S305, and the only difference is that the specific parameter values used in the calculation process are different, and only a brief introduction is given below.
[0290] Regarding the second sample similarity: self-attention processing can be performed on the local features included in the sample text description features, and based on the processing results, the importance representation value of each local feature relative to the sample audio description feature is obtained. Then, the similarities corresponding to each local feature are weighted and summed using the above-mentioned importance representation value to obtain the second sample similarity between the sample text description feature and the sample audio description feature.
[0291] Regarding the third sample similarity: self-attention processing can be performed on the local features included in the sample video description features, and based on the processing results, the importance representation value of each local feature relative to the sample audio description feature is obtained. Then, the similarities corresponding to each local feature are weighted and summed using the above-mentioned importance representation values to obtain the third sample similarity between the sample video description features and the sample audio description features.
[0292] Step L: Determine a first loss value of the neural network model according to the sample recognition result and the recognition annotation information, and adjust the model parameters of the neural network model based on the first loss value to obtain an abnormal behavior recognition model.
[0293] Specifically, after adjusting the model parameters of the neural network model based on the first loss value, the process may return to executing step K until a preset training end condition is met to obtain an abnormal behavior recognition model.
[0294] It can be seen that after the sample text description features of the sample abnormal behavior, the sample video description features of the sample object in the video frame of the sample video, and the sample audio description features of the sample audio in the sample video are input into the preset neural network model, the model can obtain the recognition result based on the sample similarity between each two categories of features in the above three categories of features. According to the error between the recognition result and the annotation information, the model can learn the association between each two categories of features in the above three categories of features, that is, the model can learn the association between multimodal features, thereby improving the accuracy of the trained model in identifying abnormal behavior.
[0295] In some cases, considering only the features of the visual and textual modalities will make it difficult for the model to learn the difference between the two behaviors. For example, sitting and daydreaming and sitting and listening to music have similar visual appearances. When only using the visual and textual modalities to train the model, it is difficult for the model to learn the difference between the two. Forced training is likely to cause the model to overfit and focus on background information. However, if the audio modality is added, there are very obvious feature differences between sitting and daydreaming and sitting and listening to music in the audio modality. The model can fully learn the above differences during the training phase, thereby helping the training of other modalities.
[0296] It can be seen that by adopting the above training method, the model can learn the association between every two features of the three types of features, namely, text description features, video description features and audio description features. In this way, by inputting the text description features, video description features and audio description features into the above abnormal behavior recognition model, the abnormal behavior recognition results output by the abnormal behavior recognition model can be obtained; of course, only the text description features and video description features can be input into the above abnormal behavior recognition model, and the abnormal behavior recognition results output by the abnormal behavior recognition model can also be obtained.
[0297] In one embodiment of the present application, the neural network model may have a feature extraction function, and thus the description text of the sample abnormal behavior, the sample video and the sample audio may be directly input into the neural network model.
[0298] Below through Fig.10 , which provides a more intuitive explanation of the architecture of the above neural network model.
[0299] See also Fig.10 , which is a schematic diagram of a neural network model provided in an embodiment of the present application.
[0300] It can be seen that after the description text of the sample abnormal behavior, the sample video and the sample audio in the sample video are input into the neural network model, the visual encoder in the model can extract features of the objects in the video frame of the sample video to obtain multiple visual local features, that is, the aforementioned video description features; the text encoder can extract features of the description text to obtain multiple text local features, that is, the aforementioned text description features; the audio encoder can extract features of the sample audio to obtain multiple audio local features, that is, the aforementioned audio description features. Then, the obtained features are input into the similarity calculation module to calculate the similarity between each two types of features.
[0301] The following is an overall introduction to an abnormal behavior recognition system provided by an embodiment of the present application.
[0302] See also Fig.11 , is a schematic diagram of an abnormal behavior identification system provided in an embodiment of the present application.
[0303] Fig.11 In the video preprocessing module, the video preprocessing module is used to perform object detection, object tracking and other processing on the video stream; the abnormal behavior recognition model is used to output the confidence of abnormal behavior of the object in the video based on the text description features stored in the client; the recognition result post-processing module is used to determine the confidence corresponding to the target abnormal behavior to be identified selected by the user from the confidence output by the model according to the user's abnormal behavior configuration information, and trigger the system alarm module when the selected confidence is greater than the confidence threshold; the system alarm module is used to push the abnormal behavior information to the user in an active push manner, so as to facilitate user confirmation and management.
[0304] Among them, the user can also feedback the missed false alarm information to the client, and the above-mentioned feedback missed false alarm information can include the description text of the abnormal behavior, and can also include the video and / or image of the abnormal behavior. After the client synchronizes the missed false alarm information to the server, the server can determine whether there is a description text of the user feedback in the base text library. If not, the above description text can be updated to the base text library, and the above description text can be input into the text feature extraction model, and the obtained text description features can be sent to the client in the form of an update package, that is, the text description features are updated. In this way, the text description features stored locally on the client are updated in a timely manner, and the client can meet the different needs of different customers according to the updated text description features.
[0305] It can be seen that compared with the related art of pre-training an abnormal behavior recognition model for a specific one or several abnormal behaviors, when a user needs to identify a new abnormal behavior other than the above-mentioned specific abnormal behavior, a model that can recognize the above-mentioned new abnormal behavior is retrained, that is, only a pre-defined closed set behavior can be recognized. In the solution provided by the embodiment of the present application, when a user needs to identify a new abnormal behavior, it is only necessary to extract the text description features of the new abnormal behavior and synchronize them to the client, so that the client updates the abnormal behavior list, thereby realizing open set abnormal behavior detection without changing the model weights, saving the cost of collecting training data and using training data to train the model, and realizing the rapid satisfaction of the differentiated needs of different users at a relatively low cost. In addition, the time required for updating the above-mentioned text features is much less than the time required for retraining the model, which can respond to the on-site needs of customers more quickly and efficiently.
[0306] Furthermore, in the related art, users need to provide feedback of private video or image samples to retrain the model, while in the solution provided in the embodiment of the present application, users can directly realize their actual needs by providing feedback description text, which is more in line with the user's understanding of the task, makes communication smoother, and protects the user's data privacy.
[0307] In the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0308] It should be noted that the two-dimensional images in this embodiment come from a public data set.
[0309] Corresponding to the above abnormal behavior identification method, the embodiment of the present application also provides an abnormal behavior identification device.
[0310] See also Fig.12 , is a schematic diagram of the structure of the first abnormal behavior identification device provided in an embodiment of the present application, the above device is applied to the client, and includes the following modules:
[0311] The feature storage module 1201 is used to locally store the text description features of each abnormal behavior in the abnormal behavior set, wherein the text description features include: multiple local features of the description text of the abnormal behavior;
[0312] An abnormal behavior configuration module 1202, configured to configure a target abnormal behavior to be identified based on a selection operation of a user in the list of abnormal behaviors;
[0313] The abnormal behavior identification module 1203 is used to obtain video description features of an object in the video in response to obtaining a video of abnormal behavior to be identified, and identify whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features, wherein the video description features include: multiple local features of the object determined based on multiple video frames of the video.
[0314] As can be seen from the above, when applying the solution provided by the embodiment of the present application to identify abnormal behaviors, the client can locally store the text description features of each abnormal behavior in the abnormal behavior set, and then configure the target abnormal behavior to be identified based on the user's selection operation in the list of each abnormal behavior. Thus, in response to obtaining a video of the abnormal behavior to be identified, the client can obtain the video description features of the object in the video, and identify whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description features and the video description features.
[0315] It can be seen that in the solution provided by the embodiment of the present application, the client provides a list of multiple abnormal behaviors for the user to choose from, so that the user can flexibly select the target abnormal behavior to be identified from the above list according to actual needs. In other words, the target abnormal behavior to be identified is not fixed, but is optional and can be flexibly changed, which can meet the different definitions of abnormal behavior for different users. The user can also change the selected target abnormal behavior as the identification needs change, which improves the flexibility in identifying abnormal behavior.
[0316] In addition, the text description features of abnormal behavior include multiple local features of the description text of the abnormal behavior, and the video description features of the object include multiple local features of the object. Compared with the overall features, the local features are fine-grained features that can reflect the characteristics of the text and the object in a more fine-grained manner, and can also more comprehensively capture the characteristic expression information of the text and the object. Therefore, when identifying whether the object has the target abnormal behavior based on the above-mentioned text description features and object description features, it can reduce information loss, which is conducive to accurately identifying fine-grained abnormal behaviors and improving the accuracy of abnormal behavior identification results.
[0317] In one embodiment of the present application, the device further includes:
[0318] A first description text obtaining module, used for obtaining a first description text of a first abnormal behavior input by a user before the abnormal behavior configuration module 1202 is triggered, wherein the first description text is: the description text input by the user when the first abnormal behavior does not exist in the list;
[0319] A first description text sending module, used for sending the first description text to a server;
[0320] A first text description feature receiving module is used to receive a first text description feature sent by the server, wherein the first text description feature includes: a plurality of local features of the description text of the first abnormal behavior determined based on the first description text;
[0321] The abnormal behavior adding module is used to store the first text description feature locally and add the first abnormal behavior to the list.
[0322] It can be seen that after the client locally stores the first text description feature of the first abnormal behavior, it can identify the first abnormal behavior that was originally unrecognizable based on the first text description feature, thereby improving the flexibility and scalability of identifying abnormal behavior.
[0323] In one embodiment of the present application, the device further includes:
[0324] A second description text obtaining module is used to obtain a second description text of the target abnormal behavior reported by the user based on the recognition result of the target abnormal behavior, and send the second description text to the server so that the server updates the text description features of the target abnormal behavior recorded in the text description feature library in the server based on the second description text.
[0325] In this way, the client can synchronize the second description text reported by the user based on the identification result of the target abnormal behavior to the server in a timely manner, so that the server updates the text description features of the target abnormal behavior recorded in the text description feature library based on the second description text, that is, the text description features included in the text description feature library maintained by the server are richer and more accurate.
[0326] In one embodiment of the present application, the device further includes:
[0327] The first text description feature updating module is used to receive an update instruction for the text description feature sent by the server; based on the text description feature carried in the update instruction, update the locally stored text description feature, wherein the update instruction is generated based on the updated text description feature in the text description feature library.
[0328] In this way, the client can obtain the updated text description features of the text description feature library of the server in a timely manner, making the locally stored text description features richer and improving the accuracy of the client in identifying abnormal behaviors based on the locally stored text description features.
[0329] In one embodiment of the present application, the second description text includes:
[0330] Text used to describe the characteristics possessed by the target abnormal behavior; and / or text used to describe the characteristics that the target abnormal behavior does not have.
[0331] In this way, the second description text can include texts of two dimensions: whether the target abnormal behavior has the characteristics or not. It has strong distinguishing power, which is conducive to highlighting the difference between the target abnormal behavior and other behaviors, and is conducive to improving the accuracy of identifying the target abnormal behavior based on the text description features of the second description text.
[0332] In one embodiment of the present application, the abnormal behavior identification module 1203 is specifically used to obtain a video of the abnormal behavior to be identified, obtain video description features of the object in the video, extract the audio in the video, and obtain audio description features of the audio, wherein the audio description features include: multiple local features of the audio; based on the locally stored text description features, the obtained audio description features and the similarity between each two types of features in the video description features, identify whether the object exhibits the target abnormal behavior.
[0333] It can be seen that in this embodiment, when identifying whether an object in a video exhibits target abnormal behavior, in addition to considering the text description features of the abnormal description text and the video description features of the video, the audio description features of the video are also considered. In this way, the modality used to identify abnormal behavior is expanded, and it is possible to more accurately identify whether an object exhibits target abnormal behavior based on the relationship between text, image and audio, thereby further improving the accuracy of the recognition results.
[0334] In one embodiment of the present application, the abnormal behavior identification module 1203 is specifically used to calculate the first similarities between each local feature in the locally stored text description feature and each local feature in the video description feature; taking the text description feature as a unit, using the self-attention mechanism, weighted summing up the first similarities corresponding to the locally stored text description features, to obtain the similarity between the locally stored text description features and the video description features; and judging whether the object exhibits the target abnormal behavior based on the obtained similarity.
[0335] It can be seen that the first similarity is the similarity between each local feature in the text description feature and each local feature in the video description feature, which can describe the relationship between the text description feature and the video description feature in a fine-grained manner. By using the self-attention mechanism, the weighted sum of the first similarities corresponding to the text description features can be further reduced. The information loss in the similarity calculation process can be further improved, and the accuracy of judging whether the object has the target abnormal behavior based on the obtained similarity is further improved.
[0336] In one embodiment of the present application, the abnormal behavior identification module 1203 is specifically used to input the locally stored text description features and the video description features into a locally deployed abnormal behavior identification model to obtain an abnormal behavior identification result output by the abnormal behavior identification model, wherein the abnormal behavior identification result represents whether the object exhibits the target abnormal behavior.
[0337] In this way, through the pre-trained abnormal behavior recognition model, it is possible to quickly and accurately identify whether the object exhibits the target abnormal behavior.
[0338] In one embodiment of the present application, the abnormal behavior recognition model is obtained according to the following training method:
[0339] Obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, and identification annotation information characterizing whether the sample objects have the sample abnormal behavior, wherein the sample text description features include: multiple local features of the description text of the sample abnormal behavior, and the sample video description features include: multiple local features of the sample objects determined based on multiple video frames of the sample video; input the sample text description features and the sample video description features into a preset neural network model to obtain a sample recognition result output by the neural network model, wherein the sample recognition result characterizes whether the sample object has the sample abnormal behavior, and the sample recognition result is generated based on a first sample similarity between the sample text description features and the sample video description features, and the first sample similarity is obtained by weighted summing the similarities between each local feature in the sample text description features and each local feature in the sample video description features using a self-attention mechanism; determine a first loss value of the neural network model according to the sample recognition result and the identification annotation information; adjust the model parameters of the neural network model based on the first loss value to obtain an abnormal behavior recognition model.
[0340] It can be seen that after the sample text description features of the sample abnormal behavior and the sample video description features of the sample object in the video frame of the sample video are input into the preset neural network model, the model can obtain the recognition result based on the first sample similarity between the sample text description features and the sample video description features. According to the error between the recognition result and the annotation information, the model can learn the association between the sample text description features of the sample abnormal behavior and the sample video description features of the sample object, so as to train a model that can accurately identify whether the object has the abnormal behavior described in the description text.
[0341] In one embodiment of the present application, the training method further includes:
[0342] Obtaining a sample audio description feature of a sample audio in the sample video, wherein the sample audio description feature comprises: a plurality of local features of the sample audio;
[0343] The step of inputting the sample text description features and the sample video description features into a preset neural network model to obtain a sample recognition result output by the neural network model includes:
[0344] The sample text description features, sample video description features and sample audio description features are input into a preset neural network model to obtain a sample recognition result output by the neural network model; the sample recognition result is generated based on the first sample similarity, the second sample similarity and the third sample similarity; the second sample similarity is obtained by adopting a self-attention mechanism and performing a weighted summation of the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature; the third sample similarity is obtained by adopting a self-attention mechanism and performing a weighted summation of the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature.
[0345] It can be seen that after the sample text description features of the sample abnormal behavior, the sample video description features of the sample object in the video frame of the sample video, and the sample audio description features of the sample audio in the sample video are input into the preset neural network model, the model can obtain the recognition result based on the sample similarity between each two categories of features in the above three categories of features. According to the error between the recognition result and the annotation information, the model can learn the association between each two categories of features in the above three categories of features, that is, the model can learn the association between multimodal features, thereby improving the accuracy of the trained model in identifying abnormal behavior.
[0346] In one embodiment of the present application, the description text of the sample abnormal behavior includes: a third description text of the sample abnormal behavior directly obtained, and a fourth description text obtained by performing text amplification processing on the third description text.
[0347] It can be seen that in this embodiment, by performing text amplification processing on the third description text, the sample data volume of the sample description text is increased, the richness and accuracy of the sample description text are improved, which is conducive to improving the performance of the abnormal behavior recognition model trained based on the sample description text.
[0348] In one embodiment of the present application, the fourth description text includes:
[0349] The description text is obtained by performing synonymous amplification on the third description text; and / or the description text is obtained by performing antisense amplification on the third description text.
[0350] In this way, through synonymous amplification and antisense amplification, the third description text can be amplified in both synonymous and antonymous dimensions, so that the amplified fourth description text is more distinctive than other texts, which is conducive to removing noise and improving the performance of the trained model.
[0351] See also Fig.13 , is a schematic diagram of the structure of a second abnormal behavior identification device provided in an embodiment of the present application, the above device is applied to a server, and includes the following modules:
[0352] A description text obtaining module 1301 is used to obtain a description text of the abnormal behavior;
[0353] The text description feature acquisition module 1302 is used to extract features from the obtained description text to obtain text description features of the abnormal behavior, wherein the text description features include: multiple local features of the obtained description text;
[0354] A second text description feature updating module 1303 is used to update the obtained text description features to a text description feature library;
[0355] The text description feature providing module 1304 is used to provide text description features to the client based on the text description feature library, so that the client can identify whether an object in the video has abnormal behavior based on the obtained text description features.
[0356] As can be seen from the above, in the solution provided by the embodiment of the present application, the server can obtain the description text of the abnormal behavior and extract the text description features of the description text, and update the text description feature library based on the obtained text description features, so that the text description features can be provided to the client based on the text description feature library. It can be seen that the server can continuously update the text description feature library, that is, the server maintains a text description feature library including a large number of text description features. The above text description feature library provides a data basis for the client. Based on the rich text description features provided by the server, the client can identify whether the object in the video of the abnormal behavior to be identified has various abnormal behaviors selected by the user, which improves the flexibility in abnormal behavior identification.
[0357] In one embodiment of the present application, the device further includes:
[0358] A first description text receiving module is used to receive a first description text of a first abnormal behavior sent by the client, wherein the first description text is: a description text input by the user when the first abnormal behavior does not exist in the list of abnormal behaviors displayed by the client;
[0359] a text description feature detection module, configured to detect, based on the first description text, whether there is a text description feature of the first abnormal behavior in the text description feature library, and if so, trigger a first feature sending module; if not, trigger a second feature sending module;
[0360] The first feature sending module is used to send the text description feature of the first abnormal behavior stored in the text description feature library to the client;
[0361] The second feature sending module is used to generate a text description feature of the first abnormal behavior based on the first description text, send the generated text description feature to the client, and add the generated text description feature to the text description feature library.
[0362] It can be seen that after receiving the first description text of the first abnormal behavior sent by the client, the server can send the text description features of the first abnormal behavior to the client. After the client locally stores the first text description features of the first abnormal behavior, it can identify the first abnormal behavior that was originally unrecognizable based on the first text description features, thereby improving the flexibility and scalability of the client in identifying abnormal behavior.
[0363] In one embodiment of the present application, the second feature sending module is specifically used to perform text amplification processing on the first description text to obtain an amplified text; and to extract multiple local features of the first description text and the amplified text respectively to obtain text description features of the first abnormal behavior.
[0364] It can be seen that in this embodiment, by performing text amplification processing on the first description text, the data volume of the amplified description text is increased, making the amplified text richer, and then by performing feature extraction on the amplified text, richer text description features of the first abnormal behavior can be obtained, which is beneficial to improving the accuracy of identifying abnormal behaviors based on the obtained text description features.
[0365] In one embodiment of the present application, the amplified text includes:
[0366] The description text is obtained by performing synonymous amplification on the first description text; and / or the description text is obtained by performing antisense amplification on the first description text.
[0367] In this way, through synonymous amplification and antisense amplification, the first description text can be amplified in both synonymous and antonymic dimensions, so that the obtained amplified text is more distinctive than other texts, and thus the text description features generated based on the first description text and the amplified text are more distinctive than the text description features of other behaviors, which is conducive to improving the accuracy of subsequent identification of abnormal behaviors based on the generated text description features.
[0368] In one embodiment of the present application, the device further includes:
[0369] The second description text receiving module is used to receive the second description text sent by the client, wherein the second description text is: the description text of the abnormal behavior reported by the user based on the recognition result of the abnormal behavior; based on the second description text, the text description features of the abnormal behavior recorded in the text description feature library in the server are updated.
[0370] For the server, it can send update instructions to the client so that the client can obtain the text description features updated in the text description feature library in a timely manner, making the text description features stored locally on the client richer and improving the accuracy of the client in identifying abnormal behavior based on the locally stored text description features.
[0371] In one embodiment of the present application, the device also includes: a third text description feature update module, which is used to generate an update instruction carrying text description features based on the text description features updated by the text description feature library; and send the text feature update instruction to the client so that the client updates the locally stored text description features based on the text description features carried in the update instruction.
[0372] It can be seen that after the server obtains the second description text of the abnormal behavior reported by the user based on the recognition result of the abnormal behavior sent by the client, it can update the text description features of the abnormal behavior recorded in the text description feature library in the server based on the second description text, that is, the text description feature library can be updated in a targeted manner based on the user's feedback on the recognition result. In this way, when the server subsequently updates the text description features to the client, the client can obtain the updated text description features based on the second description text, so that when the client identifies the abnormal behavior based on the updated text description features, it also additionally considers the text description features corresponding to the second description text, making the referenced text description features richer and further improving the accuracy of identifying abnormal behavior.
[0373] The present application embodiment provides a client, such as Fig.14 As shown, including:
[0374] Memory 1401, used for storing computer programs;
[0375] The processor 1402 is used to implement the aforementioned abnormal behavior identification method applied to the client when executing the program stored in the memory 1401.
[0376] Furthermore, the client may further include a communication bus and / or a communication interface, and the processor 1402, the communication interface, and the memory 1401 communicate with each other via the communication bus.
[0377] The present application embodiment provides a server, such as Fig.15 As shown, including:
[0378] Memory 1501, used for storing computer programs;
[0379] The processor 1502 is used to implement the aforementioned abnormal behavior identification method applied to the server when executing the program stored in the memory 1501.
[0380] In addition, the server may further include a communication bus and / or a communication interface, and the processor 1502, the communication interface, and the memory 1501 communicate with each other via the communication bus.
[0381] The communication bus mentioned in the client and server above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0382] The communication interface is used for communication between the above-mentioned client and server and other devices.
[0383] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0384] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0385] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the abnormal behavior identification method applied to a client or a server is implemented.
[0386] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the above-mentioned abnormal behavior identification method applied to a client or a server.
[0387] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0388] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0389] Each embodiment in this specification is described in a related 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, electronic device and 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.
[0390] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for identifying abnormal behavior, characterized in that: Applied to a client, the method comprises: Locally storing text description features of each abnormal behavior in the abnormal behavior set, wherein the text description features include: multiple local features of the description text of the abnormal behavior; Based on the selection operation of the user in the list of each abnormal behavior, configuring the target abnormal behavior to be identified; In response to obtaining a video of an abnormal behavior to be identified, obtaining a video description feature of an object in the video, and identifying whether the object exhibits the target abnormal behavior based on a similarity between a locally stored text description feature and the video description feature, wherein the video description feature includes: a plurality of local features of the object determined based on a plurality of video frames of the video; Wherein, the identifying whether the object exhibits the target abnormal behavior based on the similarity between the locally stored text description feature and the video description feature includes: Extract the audio in the video and obtain audio description features of the audio, wherein the audio description features include: multiple local features of the audio; input the locally stored text description features, the video description features and the audio description features into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model, wherein the abnormal behavior recognition result characterizes whether the object has the target abnormal behavior, and the abnormal behavior recognition model is obtained according to the following training method: obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, sample audio description features of sample audio in the sample videos, and identification annotation information characterizing whether the sample object has the sample abnormal behavior, wherein the sample text description features include: multiple local features of the description text of the sample abnormal behavior, the sample video description features include: multiple local features of the sample object determined based on multiple video frames of the sample video, and the sample audio description features include: multiple local features of the sample audio; input the sample text description features, the sample video description features into the sample video description features, the sample video description features into the sample video description features, and the sample audio description features into the sample audio description features. The features and the sample audio description features are input into a preset neural network model to obtain a sample recognition result output by the neural network model, wherein the sample recognition result represents whether the sample object has the sample abnormal behavior, and the sample recognition result is generated based on a first sample similarity, a second sample similarity and a third sample similarity, wherein the first sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample video description feature using a self-attention mechanism; the second sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature using a self-attention mechanism; the third sample similarity is obtained by weighted summing up the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature using a self-attention mechanism; according to the sample recognition result and the recognition annotation information, a first loss value of the neural network model is determined; based on the first loss value, the model parameters of the neural network model are adjusted to obtain an abnormal behavior recognition model.
2. The method according to claim 1, characterized in that Before configuring the target abnormal behavior to be identified based on the selection operation of the user in the list of abnormal behaviors, the method further includes: Obtaining a first description text of a first abnormal behavior input by a user, wherein the first description text is: the description text input by the user when the first abnormal behavior does not exist in the list; Sending the first description text to the server; Receiving a first text description feature sent by the server, wherein the first text description feature includes: a plurality of local features of the description text of the first abnormal behavior determined based on the first description text; The first text description feature is stored locally, and the first abnormal behavior is added to the list.
3. The method according to claim 1, characterized in that: The method further comprises: Obtaining a second description text of the target abnormal behavior reported by the user based on the recognition result of the target abnormal behavior, and sending the second description text to the server, so that the server updates the text description feature of the target abnormal behavior recorded in the text description feature library in the server based on the second description text; and / or Receive an update instruction for the text description feature sent by the server; and update the locally stored text description feature based on the text description feature carried in the update instruction, wherein the update instruction is generated based on the updated text description feature in the text description feature library.
4. The method according to claim 1, characterized in that: The description text of the sample abnormal behavior includes: a third description text of the sample abnormal behavior obtained directly, and a fourth description text obtained by performing text amplification processing on the third description text.
5. A method for identifying abnormal behavior, characterized in that: Applied to a server, the method comprises: Get the description text of abnormal behavior; Performing feature extraction on the obtained description text to obtain text description features of the abnormal behavior, wherein the text description features include: multiple local features of the obtained description text; The obtained text description features are updated to the text description feature library; Providing text description features to a client based on the text description feature library, so that the client can identify whether an object in the video has abnormal behavior based on the obtained text description features; The method in which the client identifies whether an object in a video has abnormal behavior based on the obtained text description features includes: Extract the audio in the video and obtain audio description features of the audio, wherein the audio description features include: multiple local features of the audio; input the locally stored text description features, the video description features of the object in the video and the audio description features into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model, wherein the video description features include: multiple local features of the object determined based on multiple video frames of the video, and the abnormal behavior recognition result characterizes whether the object has abnormal behavior, and the abnormal behavior recognition model is obtained according to the following training method: obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, sample audio description features of sample audio in the sample videos, and identification annotation information characterizing whether the sample object has the sample abnormal behavior, wherein the sample text description features include: multiple local features of the description text of the sample abnormal behavior, the sample video description features include: multiple local features of the sample object determined based on multiple video frames of the sample video, and the sample audio description features include: multiple local features of the sample audio; The sample text description feature, the sample video description feature and the sample audio description feature are input into a preset neural network model to obtain a sample recognition result output by the neural network model, wherein the sample recognition result represents whether the sample object has the sample abnormal behavior, and the sample recognition result is generated based on a first sample similarity, a second sample similarity and a third sample similarity, wherein the first sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample video description feature using a self-attention mechanism; the second sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature using a self-attention mechanism; the third sample similarity is obtained by weighted summing up the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature using a self-attention mechanism; a first loss value of the neural network model is determined according to the sample recognition result and the recognition annotation information; and a model parameter of the neural network model is adjusted based on the first loss value to obtain an abnormal behavior recognition model.
6. The method according to claim 5, characterized in that The method further comprises: Receive a first description text of a first abnormal behavior sent by the client, wherein the first description text is: a description text input by a user when the first abnormal behavior does not exist in the list of abnormal behaviors displayed by the client; based on the first description text, detect whether there is a text description feature of the first abnormal behavior in the text description feature library; if so, send the text description feature of the first abnormal behavior stored in the text description feature library to the client; if not, generate a text description feature of the first abnormal behavior based on the first description text, send the generated text description feature to the client, and add the generated text description feature to the text description feature library; Generating the text description feature of the first abnormal behavior based on the first description text includes: performing text amplification processing on the first description text to obtain an amplified text; extracting multiple local features of the first description text and the amplified text respectively to obtain the text description feature of the first abnormal behavior; or The method also includes: receiving a second description text sent by the client, wherein the second description text is: a description text of the abnormal behavior reported by the user based on the recognition result of the abnormal behavior; based on the second description text, updating the text description features of the abnormal behavior recorded in the text description feature library in the server; and / or generating an update instruction carrying the text description features based on the text description features updated in the text description feature library; and sending the update instruction to the client so that the client updates the locally stored text description features based on the text description features carried in the update instruction.
7. An abnormal behavior recognition device, characterized in that: Applied to a client, the device comprises: A feature storage module, used to locally store text description features of each abnormal behavior in the abnormal behavior set, wherein the text description features include: multiple local features of the description text of the abnormal behavior; An abnormal behavior configuration module, used to configure a target abnormal behavior to be identified based on a selection operation by a user in the list of abnormal behaviors; An abnormal behavior identification module is used to obtain a video of an abnormal behavior to be identified, obtain a video description feature of an object in the video, and identify whether the object has the target abnormal behavior based on the similarity between the locally stored text description feature and the video description feature, wherein the video description feature includes: a plurality of local features of the object determined based on a plurality of video frames of the video; Wherein, the abnormal behavior identification module is specifically used for: Extract the audio in the video and obtain audio description features of the audio, wherein the audio description features include: multiple local features of the audio; input the locally stored text description features, the video description features and the audio description features into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model, wherein the abnormal behavior recognition result characterizes whether the object has the target abnormal behavior, and the abnormal behavior recognition model is obtained according to the following training method: obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, sample audio description features of sample audio in the sample videos, and identification annotation information characterizing whether the sample object has the sample abnormal behavior, wherein the sample text description features include: multiple local features of the description text of the sample abnormal behavior, the sample video description features include: multiple local features of the sample object determined based on multiple video frames of the sample video, and the sample audio description features include: multiple local features of the sample audio; input the sample text description features, the sample video description features into the sample video description features, the sample video description features into the sample video description features, and the sample audio description features into the sample audio description features. The features and the sample audio description features are input into a preset neural network model to obtain a sample recognition result output by the neural network model, wherein the sample recognition result represents whether the sample object has the sample abnormal behavior, and the sample recognition result is generated based on a first sample similarity, a second sample similarity and a third sample similarity, wherein the first sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample video description feature using a self-attention mechanism; the second sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature using a self-attention mechanism; the third sample similarity is obtained by weighted summing up the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature using a self-attention mechanism; according to the sample recognition result and the recognition annotation information, a first loss value of the neural network model is determined; based on the first loss value, the model parameters of the neural network model are adjusted to obtain an abnormal behavior recognition model.
8. The device according to claim 7, characterized in that The device further includes: a first description text obtaining module, used for obtaining a first description text of a first abnormal behavior input by a user before the abnormal behavior configuration module is triggered, wherein the first description text is: a description text input by the user when the first abnormal behavior does not exist in the list; a first description text sending module, used for sending the first description text to a server; a first text description feature receiving module, used for receiving a first text description feature sent by the server, wherein the first text description feature includes: a plurality of local features of the description text of the first abnormal behavior determined based on the first description text; an abnormal behavior adding module, used for locally storing the first text description feature and adding the first abnormal behavior to the list; or The device further includes: a second description text obtaining module, which is used to obtain a second description text of the target abnormal behavior reported by the user based on the recognition result of the target abnormal behavior, and send the second description text to the server, so that the server updates the text description features of the target abnormal behavior recorded in the text description feature library in the server based on the second description text; and / or a first text description feature updating module, which is used to receive an update instruction for the text description features sent by the server; based on the text description features carried in the update instruction, update the locally stored text description features, wherein the update instruction is generated based on the updated text description features in the text description feature library; or The description text of the sample abnormal behavior includes: a third description text of the sample abnormal behavior obtained directly, and a fourth description text obtained by performing text amplification processing on the third description text.
9. An abnormal behavior recognition device, characterized in that: Applied to a server, the device comprises: A description text acquisition module is used to obtain a description text of abnormal behavior; A text description feature acquisition module is used to extract features from the obtained description text to obtain text description features of the abnormal behavior, wherein the text description features include: multiple local features of the obtained description text; A second text description feature updating module, used for updating the obtained text description features to a text description feature library; A text description feature providing module, used to provide text description features to a client based on the text description feature library, so that the client can identify whether an object in a video has abnormal behavior based on the obtained text description features; The method in which the client identifies whether an object in a video has abnormal behavior based on the obtained text description features includes: Extract the audio in the video and obtain audio description features of the audio, wherein the audio description features include: multiple local features of the audio; input the locally stored text description features, the video description features of the object in the video and the audio description features into a locally deployed abnormal behavior recognition model to obtain an abnormal behavior recognition result output by the abnormal behavior recognition model, wherein the video description features include: multiple local features of the object determined based on multiple video frames of the video, and the abnormal behavior recognition result characterizes whether the object has abnormal behavior, and the abnormal behavior recognition model is obtained according to the following training method: obtain sample text description features of sample abnormal behavior, sample video description features of sample objects in video frames of sample videos, sample audio description features of sample audio in the sample videos, and identification annotation information characterizing whether the sample object has the sample abnormal behavior, wherein the sample text description features include: multiple local features of the description text of the sample abnormal behavior, the sample video description features include: multiple local features of the sample object determined based on multiple video frames of the sample video, and the sample audio description features include: multiple local features of the sample audio; The sample text description feature, the sample video description feature and the sample audio description feature are input into a preset neural network model to obtain a sample recognition result output by the neural network model, wherein the sample recognition result represents whether the sample object has the sample abnormal behavior, and the sample recognition result is generated based on a first sample similarity, a second sample similarity and a third sample similarity, wherein the first sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample video description feature using a self-attention mechanism; the second sample similarity is obtained by weighted summing up the similarities between each local feature in the sample text description feature and each local feature in the sample audio description feature using a self-attention mechanism; the third sample similarity is obtained by weighted summing up the similarities between each local feature in the sample video description feature and each local feature in the sample audio description feature using a self-attention mechanism; a first loss value of the neural network model is determined according to the sample recognition result and the recognition annotation information; and a model parameter of the neural network model is adjusted based on the first loss value to obtain an abnormal behavior recognition model.
10. The device according to claim 9, characterized in that The device also includes: a first description text receiving module, used to receive a first description text of a first abnormal behavior sent by the client, wherein the first description text is: a description text input by a user when the first abnormal behavior does not exist in the list of abnormal behaviors displayed by the client; a text description feature detection module, used to detect whether there is a text description feature of the first abnormal behavior in the text description feature library based on the first description text, and if so, trigger a first feature sending module, and if not, trigger a second feature sending module; the first feature sending module is used to send the text description feature of the first abnormal behavior stored in the text description feature library to the client; the second feature sending module is used to generate a text description feature of the first abnormal behavior based on the first description text, send the generated text description feature to the client, and add the generated text description feature to the text description feature library; The second feature sending module is specifically used to perform text amplification processing on the first description text to obtain an amplified text; extract multiple local features of the first description text and the amplified text respectively to obtain text description features of the first abnormal behavior; or The device also includes: a second description text receiving module, which is used to receive a second description text sent by the client, wherein the second description text is: a description text of the abnormal behavior reported by the user based on the recognition result of the abnormal behavior; based on the second description text, updating the text description features of the abnormal behavior recorded in the text description feature library in the server; and / or a third text description feature updating module, which is used to generate an update instruction carrying the text description features based on the text description features updated in the text description feature library; and sending the update instruction to the client so that the client updates the locally stored text description features based on the text description features carried in the update instruction.
