WO2023029397A1 - Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product - Google Patents

Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product Download PDF

Info

Publication number
WO2023029397A1
WO2023029397A1 PCT/CN2022/077716 CN2022077716W WO2023029397A1 WO 2023029397 A1 WO2023029397 A1 WO 2023029397A1 CN 2022077716 W CN2022077716 W CN 2022077716W WO 2023029397 A1 WO2023029397 A1 WO 2023029397A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
network
training data
training
collected
Prior art date
Application number
PCT/CN2022/077716
Other languages
French (fr)
Chinese (zh)
Inventor
苏婧
苏海昇
王栋梁
甘伟豪
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023029397A1 publication Critical patent/WO2023029397A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a training data acquisition method, an abnormal behavior recognition network training method and device, computer equipment, storage media, computer programs, and computer program products.
  • the disclosure provides a training data acquisition method, an abnormal behavior recognition network training method and device, computer equipment, a storage medium, a computer program, and a computer program product.
  • An embodiment of the present disclosure provides a training data acquisition method, including:
  • An embodiment of the present disclosure provides a network training method for abnormal behavior recognition, the method comprising:
  • the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training data acquisition method;
  • the abnormal behavior recognition network is iteratively trained through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than a preset first loss threshold, or the number of iterations is greater than a preset threshold.
  • An embodiment of the present disclosure provides a training data acquisition device, including:
  • a data acquisition module configured to acquire network data and collected data containing specific abnormal behaviors
  • An action feature acquisition module configured to acquire an action feature of each of the network data and an action feature of each of the collected data
  • the training data selection module is configured to select similar network data matching the collected data from the network data according to the similarity between the action features of each of the network data and the action features of each of the collected data , and use the collected data and the similar network data as positive sample training data for specific abnormal behaviors.
  • An embodiment of the present disclosure provides an abnormal behavior recognition network training device, the device includes:
  • the training data acquisition module is configured to acquire training data, the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training sample acquisition method;
  • the network training module is configured to iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset Set the count threshold.
  • An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored.
  • the program is executed by a processor, the above training data acquisition method or abnormal behavior identification network training method is implemented.
  • An embodiment of the present disclosure provides a computer device, and the computer device includes:
  • processors one or more processors
  • memory for storing one or more programs
  • the one or more processors are made to implement the above training data acquisition method or abnormal behavior identification network training method.
  • An embodiment of the present disclosure provides a computer program, the computer program includes computer readable code, and when the computer readable code is read and executed by a computer, a part or part of the method in any embodiment of the present disclosure is realized. All steps.
  • An embodiment of the present disclosure provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, any embodiment of the present disclosure is realized Some or all of the steps in the method.
  • the present disclosure provides a training data acquisition method, an abnormal behavior identification network training method and device, computer equipment, storage media, computer programs, and computer program products, for specific abnormal behaviors, to acquire collection data including specific abnormal behaviors, and to acquire network data, and obtain the action features of the collected data and network data, and according to the similarity between the action features of each network data and the action features of the collected data, determine several similar network data of the collected data, and use the similar network data and collected data as Positive training data for specific abnormal behaviors.
  • the training data that can be used as positive samples is determined from several cheap network data, which improves the efficiency of training data acquisition, and thus speeds up the acquisition of abnormal behavior recognition networks.
  • FIG. 1 is a flow chart of a training data acquisition method provided by an embodiment of the present disclosure.
  • FIG. 2 is a flowchart of a method for obtaining similar network data provided by an embodiment of the present disclosure.
  • Fig. 3 is a schematic diagram of similar network data provided by an embodiment of the present disclosure.
  • FIG. 4 is a flowchart of a method for training an abnormal behavior recognition network provided by an embodiment of the present disclosure.
  • Fig. 5a is a flowchart of an iterative method provided by an embodiment of the present disclosure.
  • Fig. 5b is a schematic diagram of an iterative method provided by an embodiment of the present disclosure.
  • Fig. 6 is a block diagram of an apparatus for obtaining training data provided by an embodiment of the present disclosure.
  • Fig. 7 is a block diagram of an abnormal behavior recognition network training device provided by an embodiment of the present disclosure.
  • FIG. 8 is a hardware structural diagram of a computer device where a training data acquisition device or an abnormal behavior recognition network training device provided by an embodiment of the present disclosure is located.
  • first, second, third, etc. may be used in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word “if” as used herein may be interpreted as “at” or “when” or “in response to a determination.”
  • the present disclosure provides a method for obtaining training data.
  • the collected data including specific abnormal behaviors and network data are obtained, and the action characteristics of the collected data and network data are obtained, and according to each
  • the similarity between the action features of the network data and the action features of the collected data is determined, and several similar network data of the collected data are determined, and the similar network data and the collected data are used as positive sample training data for specific abnormal behaviors.
  • the training data that can be used as positive samples is determined from several cheap network data, which improves the efficiency of training data acquisition, and thus speeds up the acquisition of abnormal behavior recognition networks.
  • an embodiment of the present disclosure provides a training data acquisition method, which is used for acquiring positive sample training data of a specific abnormal behavior for the specific abnormal behavior.
  • the method for acquiring training data may be performed by a terminal device or other processing device, wherein the terminal device may be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the method for obtaining training data may be implemented in a manner in which a processor invokes computer-readable instructions stored in a memory.
  • the training data acquisition method provided by the present disclosure may include:
  • Step 101 acquiring network data and collected data including specific abnormal behaviors.
  • the method for obtaining training data in the present disclosure is aimed at a specific abnormal behavior. If it is desired to obtain training data of multiple specific abnormal behaviors, the method can be executed multiple times. Unless otherwise stated below. Collected data refers to the collected data for a specific abnormal behavior.
  • the collected data can be video or dynamic image data captured by the smart city management system, and the collected data are all data containing specific abnormal behaviors.
  • the collected data is marked data, including the first label for a specific abnormal behavior.
  • the network data may include at least one of the following: data sets published on the Internet; web crawler data; data generated based on a virtual game engine.
  • the datasets made public on the Internet refer to the training datasets made public on the Internet, in other words, the datasets that other Internet users have compiled for certain tasks, such as the K400 dataset.
  • Web crawler data refers to data sets searched and sorted from the Internet.
  • Internet public data sets refer to data sets that have been organized by other Internet users for training, while web crawler data is a Crawler, a data set obtained by sorting video data obtained by multiple crawlers.
  • the network data in the embodiments of the present disclosure are more comprehensive, making the training data more diverse.
  • the data generated based on the virtual game engine refers to the data generated by the virtual game engine, which can generate data that does not include scenes, and the generated data is more flexible, and more cheap data can be generated through the virtual game engine.
  • the network data acquired in step 101 is all unmarked data and cannot be used directly.
  • each collected data or network data contains the data of at least one person, and the specific abnormal behaviors in the collected data and network data Irrelevant data, such as a large area of background, can be cut out through portrait recognition to reduce the noise input to the abnormal behavior recognition network.
  • the method provided in this disclosure is only for positive sample training data acquisition.
  • the negative sample training data also consists of two parts, one part is the data that does not contain specific abnormal behaviors in the city and includes at least one person's data, and the other part is the data obtained from the Internet that does not contain specific abnormal behaviors. The method for obtaining the negative sample training data in the embodiment of the present disclosure is described below, and will not be repeated here.
  • the method provided in the present disclosure is used to obtain positive sample data, and the collected data is positive sample data containing labels, then the first label indicates that the data carrying the label is data containing specific abnormal behaviors.
  • negative samples have a second label.
  • Step 103 acquiring the action features of each of the network data and the action features of each of the collected data.
  • Step 105 according to the similarity between the action features of each of the network data and the action features of each of the collected data, select similar network data that matches the collected data from the network data.
  • step 103 and step 105 will be collectively described.
  • the actions of different abnormal behaviors are different.
  • the actions of different data are similar. Therefore, in order to obtain similar network data of collected data, it is necessary to find Similar network data, then first of all, it is necessary to obtain the action characteristics of the collected data and network data.
  • the network data can be collected in advance, and the corresponding action features can be extracted after collection. Then the action features of the network data can be obtained and stored before the training task of training the abnormal behavior recognition network. Then the action feature of acquiring network data may be the action feature of acquiring pre-stored network data.
  • the backbone network is a network for extracting action features trained according to a specific data set.
  • the data set required by the network of action features, this kind of data set generally adopts the data set published on the Internet, for example, the K400 data set can be used.
  • a collected data or a network data generally corresponds to an action feature, and the action feature is generally in the form of a vector.
  • the input of the backbone network is a video data or a dynamic image data
  • the output is a feature vector.
  • the action features of each network data and the action features of each collected data are obtained, including: obtaining the backbone network; extracting the action features of each collected data through the backbone network ; Obtain the pre-stored action features of each network data extracted through the backbone network.
  • the action feature of the collected data for similarity calculation can be the action feature of any collected data, or the action feature of several collected data can be synthesized into one action feature, and the synthesized action feature can be used as the similarity calculation
  • the user may also designate a most representative action feature of the collected data as the action feature for similarity calculation, which is not limited in this disclosure.
  • the method for obtaining similar network data in the embodiment of the present disclosure will be described in detail below, and will not be repeated here.
  • Step 107 adding a first label to the similar network data, and using the collected data and the similar network data as positive sample training data for specific abnormal behaviors.
  • the similar network data in order to make the similar network data available for training the abnormal behavior recognition network, it is necessary to add the first label to the similar network data, so that the similar network data can be used for supervised learning.
  • the positive sample training data used to train the abnormal behavior recognition network for specific abnormal behaviors is obtained.
  • the method for obtaining similar network data may include the following steps:
  • Step 201 obtain a backbone network.
  • the backbone network is trained through the network public data set, and the backbone network may be pre-trained, or may be trained during the execution of step 201 .
  • the backbone network is used to extract motion features from video or dynamic image data.
  • Step 203 input each collected data into the backbone network, and obtain the action feature of each collected data.
  • the input of the backbone network is video or dynamic image data
  • the output is a feature vector
  • Step 205 acquiring the characteristics of the pre-stored network data.
  • the features of the network data are extracted through the pre-trained backbone network.
  • Network data can be used to train abnormal behavior recognition networks for various abnormal behaviors. Therefore, when there is a training requirement for abnormal behavior recognition networks for various abnormal behaviors, the action features of network data are pre-extracted. Every time a training sample of an abnormal behavior is obtained, the action features of the same network data are repeatedly extracted through the backbone network, which can reduce the amount of calculation.
  • Step 207 according to the action features of all the collected data, synthesize the collected data center features.
  • the action features of all the collected data are normalized and then averaged to synthesize the collected data center features.
  • the collected data center features can synthesize the action features of each collected data and can accurately reflect the characteristics of specific abnormal behaviors.
  • the collected data center feature by synthesizing the action features of all the collected data into the collected data center feature, the collected data center feature can better reflect the characteristics of the abnormal behavior, and the selected similar network data is more accurate.
  • Step 209 Select similar network data matching the collected data according to the similarity between the action feature of each of the network data and the center feature of the collected data.
  • the feature similarity between its action feature and the collected data center feature is calculated, and the feature similarity can be cosine similarity, or Euclidean distance, and of course it can also be used to represent The value of the similarity between two vectors is not limited in this disclosure.
  • the selected similar network data may be network data whose similarity with the collected data is greater than a preset threshold. It is also possible to sort the network data according to the similarity, and select the top N network data, where N may be a value preset by the user.
  • the number N of selected similar network data can also be obtained according to other methods, such as determining according to the preset ratio of similar network data and collected data; in other words, according to the action characteristics of each network data and each collected data
  • the similarity between the action features of the data, the selection of similar network data to the collected data includes: according to the preset number ratio and the number of collected data, determine the number N of similar network data to be collected; from the network data, select N similar network data; wherein, the similarity between the action features of any similar network data and the action features of the collected data is not less than the similarity between the action features of any unselected network data and the action features of the collected data.
  • the preset quantity ratio is the quantity ratio of the similar network data to be collected and the collected data.
  • the selected similar network data when there are multiple types of network data (for example, different types can correspond to data crawled from different video websites, and different types can also correspond to different network data sets), the selected similar network data , you should choose from as many categories as possible.
  • the network data greater than the preset similarity threshold can be screened out according to the preset similarity threshold, and the screened out various categories Uniform sampling in the network data, select similar network data.
  • the trained abnormal behavior recognition network needs to have a higher recognition ability for collected data, and does not care whether the abnormal behavior recognition network has better recognition ability for similar network data, therefore, in order This enables the abnormal behavior recognition network to have a better recognition ability for the collected data.
  • the number of similar network data should not exceed the number of collected data. If the similar network data is selected according to a certain ratio, sampling can be performed according to the ratio of 1:2 between the similar network data and the data volume of the collected data to obtain positive sample training data.
  • each type of collected data can be uniformly sampled.
  • the collected data can include: 100 data of stepping on the lawn, 100 data of climbing over the wall, etc.
  • the schematic diagram of the selected similar network data is shown in Figure 3.
  • FIG 3 When there are multiple types of network data, when retrieving similar network data, if you search for each collected data separately, then for each collected data, in each type of network data, you can retrieve similar data collection.
  • some actions may carry special scenes, such as climbing, etc., which require the interaction between people and climbing things.
  • the extracted features are action features
  • network data that do not contain special scenes are generally retrieved ( For example, the network data 3) in Figure 3, although these network data do not contain specific abnormal behavior network data, but for the abnormal behavior recognition network, this kind of network data can represent actions more clearly because it does not contain scenes. Reduce noise.
  • this kind of network data does not contain specific abnormal behavior, it can make it easier for the abnormal behavior recognition network to learn the characteristics of action features, which is beneficial for training, and this kind of network data should be retained.
  • the method of obtaining negative sample training data in the embodiment of the present disclosure may be to obtain the data that contains the second label and does not contain specific abnormal behaviors that are actually captured by the smart city management system.
  • the method of obtaining such data is the same as that of the collected data , In addition, this kind of data often contains human actions, so that action features can be extracted.
  • the second label is a label added for data that does not contain a specific abnormal behavior. It is also possible to obtain several network data with the lowest similarity with the action features of the collected data from the network data as negative samples.
  • the present disclosure also provides a network training method for abnormal behavior recognition.
  • the abnormal behavior recognition network training method can be executed by terminal equipment or other processing equipment, wherein the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital processing ( Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the abnormal behavior recognition network training method may be implemented by a processor invoking computer-readable instructions stored in a memory.
  • Fig. 4 is a flow chart of an abnormal behavior recognition network training method provided by an embodiment of the present disclosure.
  • the method is used to train the abnormality for a specific abnormal behavior based on the positive sample training data obtained by the training data acquisition method in the embodiment of the present disclosure.
  • Behavior recognition network said method comprising:
  • Step 401 acquire training data, the training data includes positive sample training data and negative sample training data.
  • the positive sample training data is obtained based on the above training data acquisition method, and the negative sample data acquisition method is as described above, and will not be repeated here.
  • the positive sample training data includes a first label
  • the negative sample training data includes a second label.
  • Step 403 iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the output loss of the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset threshold.
  • the first loss threshold and the number of times threshold can be selected by the user according to the actual situation. The smaller the first loss threshold and the larger the number of times threshold, the better the network training effect, but at the same time, the amount of calculation will increase, so network-based accuracy is required. The requirements and calculation requirements are considered, and an appropriate first loss threshold and number of times threshold are selected.
  • Figure 5a is a flowchart of an iterative method provided by an embodiment of the present disclosure, including:
  • Step 511 acquiring a determination result of each of the training data; the determination result is used to represent whether the training data includes the specific abnormal behavior.
  • Step 513 for each similar network data, if the determination result of the similar network data does not match the label, discard the similar network data as 0.
  • Step 515 according to the judgment results and labels of the training data that have not been discarded, the loss output by the abnormal behavior recognition network is obtained.
  • Step 517 Update the weight of the abnormal behavior recognition network according to the output loss of the abnormal behavior recognition network.
  • step 511-step 517 will be collectively described.
  • the judgment result of each training data is obtained through the input action feature of each training data
  • the input action feature can be the action feature used when selecting the training data, or it can be the action feature in each iteration process.
  • the update of the backbone network can be to update the weight of the backbone network according to the output loss, so that the vector output by the backbone network can have a better representation ability for specific abnormal behaviors, so that the fully connected layer can better distinguish specific abnormal behaviors. training data and training data that does not contain specific abnormal behaviors, thus making the training effect better. By discarding similar network data whose judgment result does not match the label, the bias in training the abnormal behavior recognition network can be reduced.
  • the method further includes: obtaining the action features of each training data according to the backbone network; the action features are used to determine whether the training data includes Specific abnormal behavior; in each iteration, after obtaining the loss output by the abnormal behavior recognition network according to the judgment result and label value of the undiscarded training data, the method further includes: updating the weight of the backbone network according to the loss.
  • the backbone network can be updated so that the backbone network can extract action features more accurately, thereby improving the accuracy of the abnormal behavior recognition network.
  • the judgment result can be obtained through the fully connected layer network, and the classifier composed of the fully connected layer network classifies the input action feature vector to obtain the output judgment result.
  • the classifier composed of the fully connected layer network classifies the input action feature vector to obtain the output judgment result.
  • step 513 the similar network data whose judgment result does not match the label is discarded, so as to reduce the inaccuracy of the final trained binary classifier due to the similar network data inconsistent with the label during the next training, and when it is necessary to update the backbone network weight In some cases, discarding these similar network data can also prevent these similar network data from biasing the representation space of the backbone network, thereby preventing the final binary classifier from being affected.
  • the corresponding labels are only the first label and the second label, and any two numbers can be used to represent the judgment result, and any two numbers can represent the label value.
  • the result and the corresponding label both indicate that a specific abnormal behavior is included, or whether they both indicate that a specific abnormal behavior is not included, the two are consistent, and in the rest of the cases, it is determined that the result and the label do not match.
  • 0 indicates that the training data contains specific abnormal behavior
  • 1 indicates that the training data does not contain specific abnormal behavior
  • 0 indicates the first label
  • 1 indicates the second label.
  • the judgment result is 0, and the label is 0.
  • the judgment result is 1, and the label is 0, it means that the two do not match.
  • the method of determining whether it is similar network data can be judged according to whether each pre-stored training data is similar network data, or based on generating confrontation, training a discriminator, and using this discriminator to judge whether the training data is network data .
  • the method further includes: The training data is input into a discriminator; the discriminator is used to judge whether the training data is collection data; for each similar network data, if the judgment result of the similar network data does not match the label, the similar network discarding data, including: for each training data, in response to the discriminator outputting that the training data is not collected data, and the judgment result of the training data does not match the label of the training data, then combining the judgment result with the The training data with inconsistent labels are discarded.
  • the input training data does not need to include features identifying whether it is collected data, which can reduce the complexity of the abnormal behavior recognition network.
  • the loss of the abnormal behavior recognition network can be obtained according to the loss function, the loss function is a function preset by the user, the input is the judgment result and label of each training data, and the output is the loss of the network, which is used to evaluate the abnormal behavior recognition network good or bad.
  • the loss function can choose the loss function of the binary classifier.
  • weighted calculations can be performed to increase the weight of collected data and reduce the weight of similar network data. If the amount of similar network data is less than the collected data when obtaining training data, since the obtained training data has been obtained according to a certain proportion, the contribution of collected data to the loss is already greater than the loss of similar network data. Calculate Loss can be calculated without weighting.
  • the weight updated in step 517 is the weight of the abnormal behavior recognition network, in other words, what is updated is the weight of the network (which can be a fully connected layer) used in step 511, and the weight update can be updated according to the gradient descent method, or The update may be performed according to other weight update methods, which are not limited in the present disclosure.
  • the abnormal behavior recognition network in the embodiments of the present disclosure may at least include multiple modules such as a backbone network feature extractor, a discriminator, and a classifier.
  • FIG. 5b is a schematic diagram of an iterative method provided by an embodiment of the present disclosure.
  • the data in the data set (Dataset) and the auxiliary data set (Auxiliary Dataset) can be input into the backbone network feature extractor (Backbone feature extract) 501, and the feature extraction process is performed to obtain the motion feature sequence (Motion sequence) corresponding to the data set, and Auxiliary feature sequence corresponding to auxiliary dataset.
  • the data set can be understood as a collection of positive sample training data
  • the auxiliary data set can be understood as a collection of network data.
  • the action features or auxiliary features output by the backbone network feature extractor 501 can include at least spatial features (Scenario dimension) and time features. (Time dimension), according to the similarity between each auxiliary feature in the auxiliary feature sequence and each action feature in the action feature sequence, determine the set of negative sample training data from the auxiliary data set.
  • the terminal device can use the positive sample training data and the negative sample training data as training data, and can input the action features corresponding to the positive sample training data and the auxiliary features corresponding to the negative sample training data into the discriminator (Discriminator) 502 to perform feature discrimination (Feature Discriminator), the discriminator 502 is used to judge whether the current training data is collected data (for example, if it belongs to the collected data output, it is Real, if it belongs to non-collected data, it is output as Fake, etc.), wherein, the terminal device can pass according to the action feature or The scene (Scene) represented by the auxiliary feature and the type of action (action) are used to determine the current reward (Reward), and then calculate the feature loss (Feature Loss) to update the weight configured by the discriminator 502.
  • the scene (Scene) represented by the auxiliary feature and the type of action (action) are used to determine the current reward (Reward), and then calculate the feature loss (Feature Loss) to update the weight configured by the discriminator 502.
  • the action features corresponding to the positive sample training data and the auxiliary features corresponding to the negative sample training data can be input into the classifier 503 to determine the judgment result of the training data.
  • the judgment result can be Indicating whether the training data matches the label of the training data, wherein the classifier 503 may be a fully connected layer (Fully connected layers, FC).
  • FC Fully connected layers
  • the terminal device discards the training data in response to the discriminator 502 outputting that the training data is non-collection data, and the classifier 503 determines that the judgment result of the non-collection data does not match the label of the training data.
  • the terminal device can determine the classification loss (Classification Loss) according to the judgment result and label of the training data that has not been discarded, and then update the weight of the abnormal behavior recognition network.
  • the abnormal behavior recognition network can refer to the external unlabeled network data or the public datasets of the marked network, and retrieve the network data with similar similarity with the collected data, which can improve the training efficiency of the abnormal behavior recognition network. It enables the abnormal behavior recognition network to achieve good training results through a small amount of collected data without using billions of parameters, and can start the abnormal behavior recognition task in a short time.
  • the connection between data can be represented by the similarity between different data, and the abnormal behavior recognition network can retrieve similar network data associated with the collected data from a large amount of public data or network data, and jointly train Abnormal behavior recognition network.
  • the abnormal behavior recognition network for a specific abnormal behavior is described.
  • multiple abnormal behavior recognition networks for different abnormal behaviors need to be trained at the same time, multiple networks can be trained at the same time, sharing the same network.
  • a backbone network, the weights of each abnormal behavior recognition network are updated according to the losses of their respective networks, and the weights of the backbone network are updated according to the losses of all abnormal behavior recognition networks. In this way, the training efficiency is improved.
  • the present disclosure also provides embodiments of the training data acquisition device, the abnormal behavior recognition network training device and the terminal to which they are applied.
  • FIG. 6 is a block diagram of a training data acquisition device provided by an embodiment of the present disclosure, and the device includes:
  • the data acquisition module 610 is configured to acquire network data and collected data including specific abnormal behaviors.
  • the action feature acquisition module 620 is configured to acquire the action features of each of the network data and the action features of each of the collected data.
  • the training data selection module 630 is configured to select similar network data matching the collected data from the network data according to the similarity between the action features of each of the network data and the action features of each collected data, The collected data and the similar network data are used as positive sample training data for specific abnormal behaviors.
  • the network data includes at least one of the following: data sets published on the Internet; web crawler data; data generated based on a virtual game engine. Such network data is more comprehensive, making the training data more diverse.
  • the data acquisition module 610 includes: a first acquisition submodule configured to acquire a backbone network; an extraction submodule configured to extract the action feature of each of the collected data through the backbone network; the second The acquisition submodule is configured to acquire the pre-stored action features of each of the network data extracted through the backbone network.
  • the action features of the collected data can be obtained, and the action features of the network data are pre-extracted.
  • the training data selection module 630 includes: a synthesis submodule configured to synthesize the features of the collected data centers according to the action features of all the collected data; a first selection submodule configured to combine The similarity between the action feature of the data and the feature of the collected data center is to select similar network data that matches the collected data. In this way, the action features of all collected data are synthesized into a central feature, which can better reflect the characteristics of the abnormal behavior, and the selected similar network data is more accurate.
  • the training data selection module 630 includes: a determination submodule configured to determine the number N of similar network data to be collected according to the preset number ratio and the quantity of collected data; the second selection submodule , configured to select N similar network data from the network data; wherein, the similarity between the action features of any of the similar network data and the action features of the collected data is not less than that of the unselected network data The similarity between any action feature of the network data and the action feature of the collected data. In this way, the proportion of the selected similar network data and collected data satisfies certain conditions, so that the abnormal behavior recognition network will not be biased by similar network data, and has a better effect on collected data.
  • FIG. 7 is a block diagram of an abnormal behavior recognition network training device provided by an embodiment of the present disclosure, and the device includes:
  • the training data obtaining module 710 is configured to obtain training data, the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training sample obtaining method.
  • the network training module 720 is configured to iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset times threshold.
  • the positive sample training data includes a first label
  • the negative sample training data includes a second label.
  • the network training module 720 includes: a third acquisition submodule, configured to acquire a determination result of each of the training data during each iteration; the determination result is used to represent whether the training data includes the specific Abnormal behavior; the discarding submodule is configured to discard the similar network data for each similar network data if the determination result of the similar network data does not match the label; the fourth acquisition submodule is configured to The judgment result and label of the training data to obtain the loss output by the abnormal behavior recognition network; the first update submodule is configured to update the weight of the abnormal behavior recognition network according to the loss output by the abnormal behavior recognition network. In this way, similar network data that are not similar to the collected data are discarded, reducing the possibility that the abnormal behavior recognition network is biased by these data.
  • the device further includes: a fifth acquisition submodule configured to acquire the action feature of each of the training data according to the backbone network; the action feature is used to determine whether the training data includes the Specific abnormal behavior; the sixth acquisition submodule is configured to obtain the output loss of the abnormal behavior recognition network according to the judgment result and label of the training data that has not been discarded, and the device also includes: a second update submodule , configured to update the weights of the backbone network according to the loss. In this way, by updating the backbone network, the backbone network can better extract the characteristics of abnormal behavior, and improve the accuracy of the abnormal behavior recognition network.
  • the device further includes: an input submodule configured to input each of the training data into a discriminator; the discriminator is used to judge whether the training data is collected data.
  • the discarding submodule includes: a response unit configured to, for each training data, respond to the discriminator outputting that the training data is not collected data, and the judgment result of the training data does not match the label of the training data, then Discarding the training data whose determination result does not match the label. In this way, the input training data does not need to include features identifying whether it is the collected data, which reduces the complexity of the model.
  • the device embodiment since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment.
  • the device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in One place, or it can be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. It can be understood and implemented by those skilled in the art without creative effort.
  • Figure 8 shows a hardware structure diagram of the computer equipment where the above-mentioned device is located, the computer equipment may only include the training data acquisition device, may also only include the abnormal behavior recognition network training device, and may also include the training data An acquisition device and an abnormal behavior identification network training device.
  • the device may include: a processor 810 , a memory 820 , an input/output interface 830 , a communication interface 840 and a bus 80 .
  • the processor 810 , the memory 820 , the input/output interface 830 and the communication interface 840 are connected to each other within the device through the bus 850 .
  • the processor 810 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related programs to realize part or all of the technical solutions provided by the embodiments of the present disclosure.
  • a general-purpose CPU Central Processing Unit, central processing unit
  • a microprocessor an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits
  • ASIC Application Specific Integrated Circuit
  • the memory 820 can be implemented in the form of ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, and the like.
  • the memory 820 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of the present disclosure through software or firmware, the relevant program codes are stored in the memory 820 and invoked by the processor 810 for execution.
  • the input/output interface 830 is used to connect the input/output module to realize information input and output.
  • the input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions.
  • the input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc.
  • the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the communication interface 840 is used to connect a communication module (not shown in the figure), so as to realize communication interaction between the device and other devices.
  • the communication module can realize communication through wired methods (such as USB, network cable, etc.), and can also realize communication through wireless methods (such as mobile network, WIFI, Bluetooth, etc.).
  • Bus 850 includes a path for carrying information between the various components of the device (eg, processor 810, memory 820, input/output interface 830, and communication interface 840).
  • the above device only shows the processor 810, the memory 820, the input/output interface 830, the communication interface 840 and the bus 850, in the specific implementation process, the device may also include other components.
  • the above-mentioned device may only include components necessary to realize the solutions of the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored.
  • the program is executed by a processor, the above-mentioned training data acquisition method or abnormal behavior identification network training method is implemented.
  • the computer-readable storage medium may only store the computer program corresponding to the training data set acquisition method, or may only store the computer program corresponding to the abnormal behavior recognition network training method.
  • a computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device, and may be a volatile storage medium or a nonvolatile storage medium.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • An embodiment of the present disclosure also proposes a computer program, the computer program includes computer readable code, and when the computer readable code is read and executed by a computer, part of the method in any embodiment of the present disclosure is implemented or all steps.
  • An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes some or all steps of the above method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a training data acquisition method, an abnormal behavior recognition network training method and apparatus, a computer device, a storage medium, a computer program and a computer program product, the method comprising: acquiring network data, and collected data containing a specific abnormal behavior; acquiring action features of each piece of network data and collected data; and according to the similarity between the action features of each piece of network data and the action features of each piece of collected data, selecting, from the network data, similar network data that matches with the collected data, and using the collected data and the similar network data as positive sample training data for the specific abnormal behavior. According to the similarity between action features, training data that may be used as positive samples are determined from multiple pieces of network data, which improves the acquisition efficiency of training data and thereby accelerates the acquisition of abnormal behavior recognition networks.

Description

训练数据获取方法、异常行为识别网络训练方法及装置、计算机设备、存储介质、计算机程序、计算机程序产品Training data acquisition method, abnormal behavior recognition network training method and device, computer equipment, storage medium, computer program, computer program product
相关申请的交叉引用Cross References to Related Applications
本公开基于申请号为202111006832.0、申请日为2021年08月30日、申请名称为“训练数据获取方法及异常行为识别网络训练方法”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。This disclosure is based on the Chinese patent application with the application number 202111006832.0, the application date is August 30, 2021, and the application name is "Training Data Acquisition Method and Abnormal Behavior Identification Network Training Method", and claims the priority of the Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this disclosure.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种训练数据获取方法、异常行为识别网络训练方法及装置、计算机设备、存储介质、计算机程序、计算机程序产品。The present disclosure relates to the field of computer technology, and in particular to a training data acquisition method, an abnormal behavior recognition network training method and device, computer equipment, storage media, computer programs, and computer program products.
背景技术Background technique
在智慧城市管理的场景中,往往需要自动通过视频数据来识别异常行为(比如打架、攀爬等),防止异常行为对城市安全和谐产生危害。自动识别异常行为往往需要通过有标注的异常行为数据来训练异常行为识别网络。而数据的采集和标注往往需要花费较长时间,这使得短时间内无法快速训练得到异常行为识别网络。In the scenario of smart city management, it is often necessary to automatically identify abnormal behaviors (such as fighting, climbing, etc.) through video data, so as to prevent abnormal behaviors from endangering urban safety and harmony. Automatic recognition of abnormal behavior often requires training the abnormal behavior recognition network through labeled abnormal behavior data. However, the collection and labeling of data often takes a long time, which makes it impossible to quickly train and obtain abnormal behavior recognition networks in a short period of time.
发明内容Contents of the invention
本公开提供了一种训练数据获取方法、异常行为识别网络训练方法及装置、计算机设备、存储介质、计算机程序、计算机程序产品。The disclosure provides a training data acquisition method, an abnormal behavior recognition network training method and device, computer equipment, a storage medium, a computer program, and a computer program product.
本公开实施例提供了一种训练数据获取方法,包括:An embodiment of the present disclosure provides a training data acquisition method, including:
获取网络数据,及包含特定异常行为的采集数据;Obtain network data and collected data containing specific abnormal behaviors;
获取每个所述网络数据的动作特征及每个所述采集数据的动作特征;Obtaining an action feature of each of the network data and an action feature of each of the collected data;
根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。According to the similarity between the action features of each of the network data and the action features of each of the collected data, select similar network data that matches the collected data from the network data, and store the collected data And the similar network data are used as positive sample training data for specific abnormal behaviors.
本公开实施例提供了一种异常行为识别网络训练方法,所述方法包括:An embodiment of the present disclosure provides a network training method for abnormal behavior recognition, the method comprising:
获取训练数据,所述训练数据包括正样本训练数据和负样本训练数据,所述正样本训练数据基于上述的训练数据获取方法所获取;Acquiring training data, the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training data acquisition method;
通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至 所述异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。The abnormal behavior recognition network is iteratively trained through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than a preset first loss threshold, or the number of iterations is greater than a preset threshold.
本公开实施例提供了一种训练数据获取装置,包括:An embodiment of the present disclosure provides a training data acquisition device, including:
数据获取模块,配置为获取网络数据,及包含特定异常行为的采集数据;A data acquisition module configured to acquire network data and collected data containing specific abnormal behaviors;
动作特征获取模块,配置为获取每个所述网络数据的动作特征及每个所述采集数据的动作特征;An action feature acquisition module configured to acquire an action feature of each of the network data and an action feature of each of the collected data;
训练数据选取模块,配置为根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。The training data selection module is configured to select similar network data matching the collected data from the network data according to the similarity between the action features of each of the network data and the action features of each of the collected data , and use the collected data and the similar network data as positive sample training data for specific abnormal behaviors.
本公开实施例提供了一种异常行为识别网络训练装置,所述装置包括:An embodiment of the present disclosure provides an abnormal behavior recognition network training device, the device includes:
训练数据获取模块,配置为获取训练数据,所述训练数据包括正样本训练数据和负样本训练数据,所述正样本训练数据基于上述的训练样本获取方法所获取;The training data acquisition module is configured to acquire training data, the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training sample acquisition method;
网络训练模块,配置为通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至所述异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。The network training module is configured to iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset Set the count threshold.
本公开实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述的训练数据获取方法或异常行为识别网络训练方法。An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above training data acquisition method or abnormal behavior identification network training method is implemented.
本公开实施例提供了一种计算机设备,所述计算机设备包括:An embodiment of the present disclosure provides a computer device, and the computer device includes:
一个或多个处理器;one or more processors;
存储器,用于存储一个或多个程序;memory for storing one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述的训练数据获取方法或异常行为识别网络训练方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the above training data acquisition method or abnormal behavior identification network training method.
本公开实施例提供一种计算机程序,所述计算机程序包括计算机可读代码,在所述计算机可读代码被计算机读取并执行的情况下,实现本公开任一实施例中的方法的部分或全部步骤。An embodiment of the present disclosure provides a computer program, the computer program includes computer readable code, and when the computer readable code is read and executed by a computer, a part or part of the method in any embodiment of the present disclosure is realized. All steps.
本公开实施例提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序被计算机读取并执行时,实现本公开任一实施例中的方法的部分或全部步骤。An embodiment of the present disclosure provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, any embodiment of the present disclosure is realized Some or all of the steps in the method.
本公开提供了一种训练数据获取方法、异常行为识别网络训练方法及装置、计算机设备、存储介质、计算机程序、计算机程序产品,针对特定异常行为,获取包含特定异常行为的采集数据,及获取网络数据,并获取采集数据和网络数据的动作特征,并根据每个网络数据的动作特征与采集数据的动作特征的相似度,确定若干个采集数据的相似网络数据,将相似网络数据和采集数据作为特定异常行为的正样本训练数据。通过动作特征的相似度,从若干廉价的网络数据中确定出了可以作为正样本的训练数据,提升了训练数据获取效率,进而加快了异常行为识别网络的获取。The present disclosure provides a training data acquisition method, an abnormal behavior identification network training method and device, computer equipment, storage media, computer programs, and computer program products, for specific abnormal behaviors, to acquire collection data including specific abnormal behaviors, and to acquire network data, and obtain the action features of the collected data and network data, and according to the similarity between the action features of each network data and the action features of the collected data, determine several similar network data of the collected data, and use the similar network data and collected data as Positive training data for specific abnormal behaviors. Through the similarity of action features, the training data that can be used as positive samples is determined from several cheap network data, which improves the efficiency of training data acquisition, and thus speeds up the acquisition of abnormal behavior recognition networks.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能 限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入公开中并构成本公开的一部分,示出了符合本公开的实施例,并与公开一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the disclosure serve to explain the principles of the disclosure.
图1为本公开实施例提供的一种训练数据获取方法的流程图。FIG. 1 is a flow chart of a training data acquisition method provided by an embodiment of the present disclosure.
图2为本公开实施例提供的一种相似网络数据的获取方法的流程图。FIG. 2 is a flowchart of a method for obtaining similar network data provided by an embodiment of the present disclosure.
图3为本公开实施例提供的一种相似网络数据的示意图。Fig. 3 is a schematic diagram of similar network data provided by an embodiment of the present disclosure.
图4为本公开实施例提供的一种异常行为识别网络训练方法的流程图。FIG. 4 is a flowchart of a method for training an abnormal behavior recognition network provided by an embodiment of the present disclosure.
图5a为本公开实施例提供的一种迭代方法的流程图。Fig. 5a is a flowchart of an iterative method provided by an embodiment of the present disclosure.
图5b为本公开实施例提供的一种迭代方法的示意图。Fig. 5b is a schematic diagram of an iterative method provided by an embodiment of the present disclosure.
图6为本公开实施例提供的一种训练数据获取装置的框图。Fig. 6 is a block diagram of an apparatus for obtaining training data provided by an embodiment of the present disclosure.
图7为本公开实施例提供的一种异常行为识别网络训练装置的框图。Fig. 7 is a block diagram of an abnormal behavior recognition network training device provided by an embodiment of the present disclosure.
图8为本公开实施例提供的一种训练数据获取装置或异常行为识别网络训练装置所在计算机设备的一种硬件结构图。FIG. 8 is a hardware structural diagram of a computer device where a training data acquisition device or an abnormal behavior recognition network training device provided by an embodiment of the present disclosure is located.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the present disclosure is for the purpose of describing particular embodiments only, and is not intended to limit the present disclosure. As used in this disclosure and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present disclosure, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."
在智慧城市的管理中,为了维护城市的安全和谐,需要通过视频数据等识别城市中的异常行为(比如打架、攀爬等)。为了识别异常行为,通常是针对每种异常行为,通过大量已标注的数据来训练异常行为识别网络,以通过训练得到的异常行为识别网络来对该种异常行为进行识别。In the management of smart cities, in order to maintain the safety and harmony of the city, it is necessary to identify abnormal behaviors in the city (such as fighting, climbing, etc.) through video data. In order to identify abnormal behaviors, usually for each abnormal behavior, a large amount of labeled data is used to train the abnormal behavior recognition network, so as to identify the abnormal behavior through the trained abnormal behavior recognition network.
而这个过程中会存在一些问题,由于训练异常行为识别网络需要大量已标注好的数 据,而数据的获取通常需要较长时间,数据的标注也需要耗费较大人力。这样使得在收到一个异常行为识别网络的训练任务时,由于只有少量的已标注数据,造成无法快速得到该异常行为识别网络;如果只是根据少量的数据来进行训练,又会使得该异常行为识别网络的精度难以达到可以使用的精度要求。However, there will be some problems in this process. Because training the abnormal behavior recognition network requires a large amount of labeled data, and the acquisition of data usually takes a long time, and the labeling of data also requires a lot of manpower. In this way, when receiving a training task of an abnormal behavior recognition network, because there is only a small amount of labeled data, the abnormal behavior recognition network cannot be obtained quickly; if only a small amount of data is used for training, it will make the abnormal behavior recognition The accuracy of the network is difficult to meet the accuracy requirements that can be used.
为了解决上述问题,本公开提供了一种训练数据获取方法,针对特定异常行为,获取包括特定异常行为的采集数据,及获取网络数据,并获取采集数据和网络数据的动作特征,并根据每个网络数据的动作特征与采集数据的动作特征的相似度,确定若干个采集数据的相似网络数据,将相似网络数据和采集数据作为特定异常行为的正样本训练数据。通过动作特征的相似度,从若干廉价的网络数据中确定出了可以作为正样本的训练数据,提升了训练数据获取效率,进而加快了异常行为识别网络的获取。In order to solve the above problems, the present disclosure provides a method for obtaining training data. For specific abnormal behaviors, the collected data including specific abnormal behaviors and network data are obtained, and the action characteristics of the collected data and network data are obtained, and according to each The similarity between the action features of the network data and the action features of the collected data is determined, and several similar network data of the collected data are determined, and the similar network data and the collected data are used as positive sample training data for specific abnormal behaviors. Through the similarity of action features, the training data that can be used as positive samples is determined from several cheap network data, which improves the efficiency of training data acquisition, and thus speeds up the acquisition of abnormal behavior recognition networks.
接下来对本公开实施例进行详细说明。Next, the embodiments of the present disclosure will be described in detail.
在一些实施例中,本公开实施例提供了一种训练数据获取方法,该方法用于针对特定异常行为,获取所述特定异常行为的正样本训练数据。该训练数据获取方法可以由终端设备或其他处理设备执行,其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该训练数据获取方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In some embodiments, an embodiment of the present disclosure provides a training data acquisition method, which is used for acquiring positive sample training data of a specific abnormal behavior for the specific abnormal behavior. The method for acquiring training data may be performed by a terminal device or other processing device, wherein the terminal device may be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementation manners, the method for obtaining training data may be implemented in a manner in which a processor invokes computer-readable instructions stored in a memory.
下面将结合图1对训练数据获取方法进行详细说明。The method for obtaining training data will be described in detail below with reference to FIG. 1 .
如图1所示,本公开提供的训练数据获取方法可以包括:As shown in Figure 1, the training data acquisition method provided by the present disclosure may include:
步骤101,获取网络数据,及包含特定异常行为的采集数据。 Step 101, acquiring network data and collected data including specific abnormal behaviors.
首先需要说明的是,本公开中的训练数据获取方法是针对一种特定异常行为而言的,如果要获取多种特定异常行为的训练数据,可以将该方法执行多遍。下文中如无其他说明。采集数据指的都是针对一种特定异常行为的采集数据。First of all, it should be noted that the method for obtaining training data in the present disclosure is aimed at a specific abnormal behavior. If it is desired to obtain training data of multiple specific abnormal behaviors, the method can be executed multiple times. Unless otherwise stated below. Collected data refers to the collected data for a specific abnormal behavior.
采集数据可以是通过智慧城市管理系统所拍摄到的视频或者动态图像数据,采集数据都是包含特定异常行为的数据。此外,采集数据是已经标注好的数据,包括针对特定异常行为的第一标签。The collected data can be video or dynamic image data captured by the smart city management system, and the collected data are all data containing specific abnormal behaviors. In addition, the collected data is marked data, including the first label for a specific abnormal behavior.
网络数据可以包括以下至少之一:互联网公开的数据集;网络爬虫数据;基于虚拟游戏引擎生成的数据。互联网公开的数据集指的是互联网公开的训练数据集,换言之,是其他互联网用户已经整理完成的针对某些任务的数据集,比如K400数据集等。网络爬虫数据指的是从网络上搜索整理的数据集,与互联网公开数据集相比,互联网公开数据集指的是其他互联网用户已经整理好的用于训练的数据集,而网络爬虫数据是进行爬虫,将多个爬虫到的视频数据进行整理所得到的数据集。本公开实施例中的网络数据更加全面,使得训练数据更加多样。基于虚拟游戏引擎生成的数据指的是虚拟游戏引擎所生成的数据,可以生成不包含场景的数据,所生成的数据更加灵活,通过虚拟游戏引擎可以生成较多廉价的数据。此外,步骤101中所获取的网络数据都是未标注的数据,无 法直接使用。The network data may include at least one of the following: data sets published on the Internet; web crawler data; data generated based on a virtual game engine. The datasets made public on the Internet refer to the training datasets made public on the Internet, in other words, the datasets that other Internet users have compiled for certain tasks, such as the K400 dataset. Web crawler data refers to data sets searched and sorted from the Internet. Compared with Internet public data sets, Internet public data sets refer to data sets that have been organized by other Internet users for training, while web crawler data is a Crawler, a data set obtained by sorting video data obtained by multiple crawlers. The network data in the embodiments of the present disclosure are more comprehensive, making the training data more diverse. The data generated based on the virtual game engine refers to the data generated by the virtual game engine, which can generate data that does not include scenes, and the generated data is more flexible, and more cheap data can be generated through the virtual game engine. In addition, the network data acquired in step 101 is all unmarked data and cannot be used directly.
由于特定异常行为一般是人所做的,且至少需要一个人的参与,所以,每个采集数据或网络数据中,都是包含至少一个人的数据,采集数据和网络数据中的与特定异常行为无关的数据,比如大面积的背景,都可以通过人像识别裁减掉,减少输入异常行为识别网络的噪音。Since specific abnormal behaviors are generally done by people and require the participation of at least one person, each collected data or network data contains the data of at least one person, and the specific abnormal behaviors in the collected data and network data Irrelevant data, such as a large area of background, can be cut out through portrait recognition to reduce the noise input to the abnormal behavior recognition network.
此外,考虑到异常行为识别网络的训练不能仅有正样本(包含特定异常行为的数据),还需要有负样本(不包含特定异常行为的数据),本公开所提供的方法只是针对正样本训练数据的获取。负样本训练数据同样由两部分组成,一部分是拍摄到的城市中发生的不包含特定异常行为,且至少包括一个人的数据,另一部分是从网络上获取的不包含特定异常行为的数据。本公开实施例的负样本训练数据的获取方法在下文有说明,在此暂不赘述。In addition, considering that the training of abnormal behavior recognition network can not only have positive samples (data containing specific abnormal behavior), but also negative samples (data not containing specific abnormal behavior), the method provided in this disclosure is only for positive sample training data acquisition. The negative sample training data also consists of two parts, one part is the data that does not contain specific abnormal behaviors in the city and includes at least one person's data, and the other part is the data obtained from the Internet that does not contain specific abnormal behaviors. The method for obtaining the negative sample training data in the embodiment of the present disclosure is described below, and will not be repeated here.
由于本公开所提供的方法是用于获取正样本数据,采集数据是包含标签的正样本数据,那么第一标签即表征携带该标签的数据是包含特定异常行为的数据。相对应的,负样本具有第二标签。Since the method provided in the present disclosure is used to obtain positive sample data, and the collected data is positive sample data containing labels, then the first label indicates that the data carrying the label is data containing specific abnormal behaviors. Correspondingly, negative samples have a second label.
步骤103,获取每个所述网络数据的动作特征及每个所述采集数据的动作特征。 Step 103, acquiring the action features of each of the network data and the action features of each of the collected data.
步骤105,根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据。 Step 105, according to the similarity between the action features of each of the network data and the action features of each of the collected data, select similar network data that matches the collected data from the network data.
接下来将对步骤103和步骤105进行统一说明。本公开实施例中,不同的异常行为的动作是不同的,对于同一种异常行为而言,不同的数据的动作是相似的,因此,为了获取采集数据的相似网络数据,需要基于动作特征来寻找相似的网络数据,那么首先就需要获取采集数据和网络数据的动作特征。Next, step 103 and step 105 will be collectively described. In the embodiment of the present disclosure, the actions of different abnormal behaviors are different. For the same abnormal behavior, the actions of different data are similar. Therefore, in order to obtain similar network data of collected data, it is necessary to find Similar network data, then first of all, it is necessary to obtain the action characteristics of the collected data and network data.
网络数据可以是事先收集的,在收集后就可以提取相应的动作特征,那么网络数据的动作特征可以是在获取到训练异常行为识别网络的训练任务前,就已经获取到且存储起来的数据,那么获取网络数据的动作特征可以是获取预先存储的网络数据的动作特征。The network data can be collected in advance, and the corresponding action features can be extracted after collection. Then the action features of the network data can be obtained and stored before the training task of training the abnormal behavior recognition network. Then the action feature of acquiring network data may be the action feature of acquiring pre-stored network data.
对于采集数据而言,其动作特征需要通过主干网络(backbone)来提取,主干网络为根据特定的数据集所训练的,用于提取动作特征的网络,特定的数据集指的是用于训练提取动作特征的网络所需要的数据集,这种数据集一般是采用网络上所公开的数据集,比如可以采用K400数据集。For the collected data, its action features need to be extracted through the backbone network (backbone). The backbone network is a network for extracting action features trained according to a specific data set. The data set required by the network of action features, this kind of data set generally adopts the data set published on the Internet, for example, the K400 data set can be used.
一个采集数据或者一个网络数据一般对应于一个动作特征,动作特征一般是向量的形式。换言之主干网络的输入是一个视频数据或者一个动态图像数据,输出为一个特征向量。A collected data or a network data generally corresponds to an action feature, and the action feature is generally in the form of a vector. In other words, the input of the backbone network is a video data or a dynamic image data, and the output is a feature vector.
在采集数据的动作特征是通过主干网络提取的情况下,获取每个网络数据的动作特征及每个采集数据的动作特征,包括:获取主干网络;通过主干网络,提取每个采集数据的动作特征;获取预先存储的通过主干网络所提取的每个网络数据的动作特征。When the action features of the collected data are extracted through the backbone network, the action features of each network data and the action features of each collected data are obtained, including: obtaining the backbone network; extracting the action features of each collected data through the backbone network ; Obtain the pre-stored action features of each network data extracted through the backbone network.
其中,进行相似度计算的采集数据的动作特征,可以是选取任一采集数据的动作特 征,也可以将若干个采集数据的动作特征合成为一个动作特征,将合成的一个动作特征作为相似度计算的动作特征,当然也可以用户指定一个最具有代表性的采集数据的动作特征作为相似度计算的动作特征,本公开在此不做限制。本公开实施例的相似网络数据的获取方法将在下文进行详细说明,在此暂不赘述。Among them, the action feature of the collected data for similarity calculation can be the action feature of any collected data, or the action feature of several collected data can be synthesized into one action feature, and the synthesized action feature can be used as the similarity calculation Of course, the user may also designate a most representative action feature of the collected data as the action feature for similarity calculation, which is not limited in this disclosure. The method for obtaining similar network data in the embodiment of the present disclosure will be described in detail below, and will not be repeated here.
步骤107,添加第一标签至所述相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。 Step 107, adding a first label to the similar network data, and using the collected data and the similar network data as positive sample training data for specific abnormal behaviors.
在一些实施例中,为了使得相似网络数据可以用于训练异常行为识别网络,需要添加第一标签至相似网络数据,使得可以用相似网络数据进行有监督学习。通过上述方法即获取到了用于训练针对特定异常行为的异常行为识别网络的正样本训练数据。In some embodiments, in order to make the similar network data available for training the abnormal behavior recognition network, it is necessary to add the first label to the similar network data, so that the similar network data can be used for supervised learning. Through the above method, the positive sample training data used to train the abnormal behavior recognition network for specific abnormal behaviors is obtained.
接下来将结合图2,对相似网络数据的获取方法进行详细说明,本公开实施例中相似网络数据的获取方法可以包括以下步骤:Next, the method for obtaining similar network data will be described in detail in conjunction with FIG. 2 . The method for obtaining similar network data in an embodiment of the present disclosure may include the following steps:
步骤201,获取主干网络。 Step 201, obtain a backbone network.
其中,如上所述,主干网络是通过网络公开数据集所训练的,主干网络可以是预先训练的,也可以是在步骤201执行时所训练的。主干网络用于提取视频或动态图像数据的动作特征。Wherein, as mentioned above, the backbone network is trained through the network public data set, and the backbone network may be pre-trained, or may be trained during the execution of step 201 . The backbone network is used to extract motion features from video or dynamic image data.
步骤203,将每个采集数据输入主干网络,获取每个采集数据的动作特征。 Step 203, input each collected data into the backbone network, and obtain the action feature of each collected data.
其中,主干网络的输入为视频或动态图像数据,输出为一个特征向量。Among them, the input of the backbone network is video or dynamic image data, and the output is a feature vector.
步骤205,获取预先存储的网络数据的特征。 Step 205, acquiring the characteristics of the pre-stored network data.
网络数据的特征,是通过预训练的主干网络所提取的。网络数据可以用于训练针对多种不同异常行为的异常行为识别网络,因此在存在针对多种不同异常行为的异常行为识别网络的训练需求的情况下,预先提取网络数据的动作特征,就无需在每次获取某一异常行为的训练样本时,重复通过主干网络提取相同的网络数据的动作特征,可以减少计算量。The features of the network data are extracted through the pre-trained backbone network. Network data can be used to train abnormal behavior recognition networks for various abnormal behaviors. Therefore, when there is a training requirement for abnormal behavior recognition networks for various abnormal behaviors, the action features of network data are pre-extracted. Every time a training sample of an abnormal behavior is obtained, the action features of the same network data are repeatedly extracted through the backbone network, which can reduce the amount of calculation.
步骤207,根据所有所述采集数据的动作特征,合成采集数据中心特征。 Step 207, according to the action features of all the collected data, synthesize the collected data center features.
在一些实施例中,将全部采集数据的动作特征归一化后求平均,合成为采集数据中心特征,采集数据中心特征可以综合各个采集数据的动作特征,能准确反映出特定异常行为的特征。本公开实施例中,通过将所有采集数据的动作特征合成为采集数据中心特征,使得采集数据中心特征更能反映该异常行为的特点,选取的相似网络数据更为准确。In some embodiments, the action features of all the collected data are normalized and then averaged to synthesize the collected data center features. The collected data center features can synthesize the action features of each collected data and can accurately reflect the characteristics of specific abnormal behaviors. In the embodiment of the present disclosure, by synthesizing the action features of all the collected data into the collected data center feature, the collected data center feature can better reflect the characteristics of the abnormal behavior, and the selected similar network data is more accurate.
步骤209,根据每个所述网络数据的动作特征与所述采集数据中心特征之间的相似度,选取与所述采集数据匹配的相似网络数据。Step 209: Select similar network data matching the collected data according to the similarity between the action feature of each of the network data and the center feature of the collected data.
在一些实施例中,针对每个网络数据,计算其动作特征和采集数据中心特征的特征相似度,特征相似度可以是余弦相似度,也可以是欧氏距离,当然也可以是其他用于表示两个向量相似度的值,本公开在此不做限制。In some embodiments, for each network data, the feature similarity between its action feature and the collected data center feature is calculated, and the feature similarity can be cosine similarity, or Euclidean distance, and of course it can also be used to represent The value of the similarity between two vectors is not limited in this disclosure.
选取的相似网络数据,可以是和采集数据的相似度大于预设阈值的网络数据。也可以是根据相似度,将网络数据进行排序,选取前N个网络数据,N可以是用户预先设置的值。The selected similar network data may be network data whose similarity with the collected data is greater than a preset threshold. It is also possible to sort the network data according to the similarity, and select the top N network data, where N may be a value preset by the user.
此外,选取的相似网络数据的数量N也可以是根据其他方法获取的,比如根据预设的相似网络数据和采集数据的数量比例来确定;换言之,根据每个网络数据的动作特征与每个采集数据的动作特征之间的相似度,选取与采集数据的相似网络数据,包括:根据预设数量比例,及采集数据的数量,确定需要采集的相似网络数据的数量N;从网络数据中,选取N个相似网络数据;其中,任一相似网络数据的动作特征与采集数据的动作特征的相似度,不小于未被选取的任一网络数据的动作特征与采集数据的动作特征的相似度。其中,预设数量比例,是需要采集的相似网络数据和采集数据的数量比例。通过本公开中的实施例,所选择的相似网络数据和采集数据比例满足一定条件,降低异常行为识别网络根据相似网络数据进行训练,得到的训练结果不满足预设条件的情况,针对采集数据有较好的效果。In addition, the number N of selected similar network data can also be obtained according to other methods, such as determining according to the preset ratio of similar network data and collected data; in other words, according to the action characteristics of each network data and each collected data The similarity between the action features of the data, the selection of similar network data to the collected data, includes: according to the preset number ratio and the number of collected data, determine the number N of similar network data to be collected; from the network data, select N similar network data; wherein, the similarity between the action features of any similar network data and the action features of the collected data is not less than the similarity between the action features of any unselected network data and the action features of the collected data. Wherein, the preset quantity ratio is the quantity ratio of the similar network data to be collected and the collected data. Through the embodiments of the present disclosure, the proportion of the selected similar network data and collected data satisfies certain conditions, reducing the situation that the abnormal behavior recognition network is trained according to similar network data, and the obtained training results do not meet the preset conditions. better effect.
在一些实施例中,在网络数据有多个种类(比如不同种类可以对应于从不同视频网站上爬虫下来的数据,不同种类也可以对应于不同网络数据集)的情况下,选取的相似网络数据,应尽可能地从各个种类中进行选择。在一些实施例中,在确定了需要选取的相似网络数据的数量N后,可以先根据预设的相似度阈值,筛选出大于预设的相似度阈值的网络数据,在从筛选出的各个种类的网络数据中均匀采样,选取相似网络数据。In some embodiments, when there are multiple types of network data (for example, different types can correspond to data crawled from different video websites, and different types can also correspond to different network data sets), the selected similar network data , you should choose from as many categories as possible. In some embodiments, after determining the number N of similar network data to be selected, the network data greater than the preset similarity threshold can be screened out according to the preset similarity threshold, and the screened out various categories Uniform sampling in the network data, select similar network data.
在一些实施例中,考虑到所训练的异常行为识别网络需要对采集数据有更高的识别能力,而并不关心该异常行为识别网络对于相似网络数据是否有较好的识别能力,因此,为了使得异常行为识别网络能对采集数据有更好的识别能力,训练数据中,相似网络数据的数量需要不超过采集数据的数量。如果是按照一定比例来选取相似网络数据,可以按照相似网络数据与采集数据的数据量之间为1:2的比例进行采样,得到正样本训练数据。为了增加采集数据的多样性,可以使得每类采集数据均匀采样,例如:采集数据可以包括:100个踩草坪行为的数据,100个翻墙行为的数据等。In some embodiments, considering that the trained abnormal behavior recognition network needs to have a higher recognition ability for collected data, and does not care whether the abnormal behavior recognition network has better recognition ability for similar network data, therefore, in order This enables the abnormal behavior recognition network to have a better recognition ability for the collected data. In the training data, the number of similar network data should not exceed the number of collected data. If the similar network data is selected according to a certain ratio, sampling can be performed according to the ratio of 1:2 between the similar network data and the data volume of the collected data to obtain positive sample training data. In order to increase the diversity of collected data, each type of collected data can be uniformly sampled. For example, the collected data can include: 100 data of stepping on the lawn, 100 data of climbing over the wall, etc.
选取出的相似网络数据的示意图如图3所示。网络数据有多种类别的情况下,当检索相似网络数据时,如果针对每个采集数据分别检索,那么针对每个采集数据,在每一类网络数据中,都可以检索出与该采集数据最为相似的采集数据。此外,有些动作可能会携带特殊的场景,比如攀爬等,需要人与攀爬的东西的交互,而由于所提取的特征是动作特征,所以一般也会检索到不包含特殊场景的网络数据(比如图3中的网络数据3),这些网络数据虽然并不是包含特定异常行为的网络数据,但是对于异常行为识别网络来说,这种网络数据由于不包含场景,反而能更清楚的表征动作,减少噪声。换言之这种网络数据虽然不包含特定异常行为,但是能让异常行为识别网络更容易学习到动作特征的特点,对于训练有益,这种网络数据应该保留。The schematic diagram of the selected similar network data is shown in Figure 3. When there are multiple types of network data, when retrieving similar network data, if you search for each collected data separately, then for each collected data, in each type of network data, you can retrieve similar data collection. In addition, some actions may carry special scenes, such as climbing, etc., which require the interaction between people and climbing things. Since the extracted features are action features, network data that do not contain special scenes are generally retrieved ( For example, the network data 3) in Figure 3, although these network data do not contain specific abnormal behavior network data, but for the abnormal behavior recognition network, this kind of network data can represent actions more clearly because it does not contain scenes. Reduce noise. In other words, although this kind of network data does not contain specific abnormal behavior, it can make it easier for the abnormal behavior recognition network to learn the characteristics of action features, which is beneficial for training, and this kind of network data should be retained.
在获取正样本训练数据后,还需要获取负样本训练数据。本公开实施例中的获取负样本训练数据的方法,可以是获取包含第二标签的,通过智慧城市管理系统真实拍摄到的不包含特定异常行为的数据,这种数据与采集数据的获取方法相同,此外,这种数据中往往包含人的动作,这样才能提取到动作特征。第二标签是针对不包含特定异常行为的数据,所添加的标签。还可以从网络数据中,获取同采集数据的动作特征相似度最低 的若干个网络数据作为负样本。After obtaining the positive sample training data, it is also necessary to obtain the negative sample training data. The method of obtaining negative sample training data in the embodiment of the present disclosure may be to obtain the data that contains the second label and does not contain specific abnormal behaviors that are actually captured by the smart city management system. The method of obtaining such data is the same as that of the collected data , In addition, this kind of data often contains human actions, so that action features can be extracted. The second label is a label added for data that does not contain a specific abnormal behavior. It is also possible to obtain several network data with the lowest similarity with the action features of the collected data from the network data as negative samples.
在一些实施例中,在获取到正样本训练数据和负样本训练数据后,需要通过正样本训练数据和负样本训练数据,训练得到异常行为识别网络。因此,本公开还提供了一种异常行为识别网络训练方法,接下来将结合图4来对本公开提供的一种异常行为识别网络训练方法进行详细说明。该异常行为识别网络训练方法可以由终端设备或其他处理设备执行,其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该异常行为识别网络训练方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In some embodiments, after the positive sample training data and the negative sample training data are obtained, the abnormal behavior recognition network needs to be trained through the positive sample training data and the negative sample training data. Therefore, the present disclosure also provides a network training method for abnormal behavior recognition. Next, the network training method for abnormal behavior recognition provided by the present disclosure will be described in detail with reference to FIG. 4 . The abnormal behavior recognition network training method can be executed by terminal equipment or other processing equipment, wherein the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital processing ( Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementation manners, the abnormal behavior recognition network training method may be implemented by a processor invoking computer-readable instructions stored in a memory.
图4为本公开实施例提供的一种异常行为识别网络训练方法的流程图,该方法用于基于本公开实施例中训练数据获取方法所获取的正样本训练数据,训练针对特定异常行为的异常行为识别网络;所述方法包括:Fig. 4 is a flow chart of an abnormal behavior recognition network training method provided by an embodiment of the present disclosure. The method is used to train the abnormality for a specific abnormal behavior based on the positive sample training data obtained by the training data acquisition method in the embodiment of the present disclosure. Behavior recognition network; said method comprising:
步骤401,获取训练数据,训练数据包括正样本训练数据和负样本训练数据。 Step 401, acquire training data, the training data includes positive sample training data and negative sample training data.
正样本训练数据是基于上述训练数据获取方法所获取的,负样本数据的获取方法如上文所述,在此不再赘述。此外,为了区分正样本训练数据和负样本训练数据,及为了进行有监督学习,正样本训练数据包括第一标签,负样本训练数据包括第二标签。The positive sample training data is obtained based on the above training data acquisition method, and the negative sample data acquisition method is as described above, and will not be repeated here. In addition, in order to distinguish the positive sample training data from the negative sample training data, and to perform supervised learning, the positive sample training data includes a first label, and the negative sample training data includes a second label.
步骤403,通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。 Step 403, iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the output loss of the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset threshold.
第一损失阈值和次数阈值可以是用户根据实际情况所选择的,第一损失阈值越小,次数阈值越大,网络训练效果越好,但是同时,计算量会增大,因此需要基于网络的精度要求和计算量要求两方面进行考虑,选取合适的第一损失阈值和次数阈值。The first loss threshold and the number of times threshold can be selected by the user according to the actual situation. The smaller the first loss threshold and the larger the number of times threshold, the better the network training effect, but at the same time, the amount of calculation will increase, so network-based accuracy is required The requirements and calculation requirements are considered, and an appropriate first loss threshold and number of times threshold are selected.
接下来将对步骤403进行详细说明。如图5a所示,图5a为本公开实施例提供的一种迭代方法的流程图,包括:Next, step 403 will be described in detail. As shown in Figure 5a, Figure 5a is a flowchart of an iterative method provided by an embodiment of the present disclosure, including:
步骤511,获取每个所述训练数据的判定结果;所述判定结果用于表征所述训练数据是否包括所述特定异常行为。 Step 511, acquiring a determination result of each of the training data; the determination result is used to represent whether the training data includes the specific abnormal behavior.
步骤513,针对每个相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃0。 Step 513, for each similar network data, if the determination result of the similar network data does not match the label, discard the similar network data as 0.
步骤515,根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失。Step 515 , according to the judgment results and labels of the training data that have not been discarded, the loss output by the abnormal behavior recognition network is obtained.
步骤517,根据所述异常行为识别网络输出的损失,更新所述异常行为识别网络的权重。Step 517: Update the weight of the abnormal behavior recognition network according to the output loss of the abnormal behavior recognition network.
接下来将对步骤511-步骤517进行统一说明。Next, step 511-step 517 will be collectively described.
步骤511中,每个训练数据的判定结果是通过输入的每个训练数据的动作特征获取的,所输入的动作特征可以是选取训练数据时所使用的动作特征,也可以是每次迭代过 程中,重新根据更新后的主干网络所获取的。主干网络的更新可以是根据输出的损失,更新主干网络的权重,这样使得主干网络所输出的向量能对特定异常行为有更好的表征能力,使得全连接层能更好地区分包含特定异常行为的训练数据和不包含特定异常行为的训练数据,进而使得训练效果更好。通过丢弃判定结果与标签不符的相似网络数据,可以降低训练异常行为识别网络时出现偏差的情况。In step 511, the judgment result of each training data is obtained through the input action feature of each training data, the input action feature can be the action feature used when selecting the training data, or it can be the action feature in each iteration process. , obtained again according to the updated backbone network. The update of the backbone network can be to update the weight of the backbone network according to the output loss, so that the vector output by the backbone network can have a better representation ability for specific abnormal behaviors, so that the fully connected layer can better distinguish specific abnormal behaviors. training data and training data that does not contain specific abnormal behaviors, thus making the training effect better. By discarding similar network data whose judgment result does not match the label, the bias in training the abnormal behavior recognition network can be reduced.
换言之,每次迭代中,在将每个训练数据的特征输入全连接层网络前,所述方法还包括:根据主干网络,获取每个训练数据的动作特征;动作特征用于判定训练数据是否包括特定异常行为;每次迭代中,在根据未被丢弃的训练数据的判定结果和标签值,获得异常行为识别网络输出的损失后,方法还包括:根据损失,更新主干网络的权重。本公开实施例中,可以通过更新主干网络,使得主干网络可以更加准确地提取动作特征,进而提高异常行为识别网络的准确度。In other words, in each iteration, before the features of each training data are input into the fully connected layer network, the method further includes: obtaining the action features of each training data according to the backbone network; the action features are used to determine whether the training data includes Specific abnormal behavior; in each iteration, after obtaining the loss output by the abnormal behavior recognition network according to the judgment result and label value of the undiscarded training data, the method further includes: updating the weight of the backbone network according to the loss. In the embodiments of the present disclosure, the backbone network can be updated so that the backbone network can extract action features more accurately, thereby improving the accuracy of the abnormal behavior recognition network.
其中,步骤511中,判定结果可以通过全连接层网络获取,全连接层网络所构成的分类器,对输入的动作特征向量进行分类,得到输出的判定结果,本公开中所需要训练的为用于获取判定结果的二分类器。通过廉价的数据,能获取到精度足够的二分类器,这样,就快速得到了该二分类器,即异常行为识别网络。Among them, in step 511, the judgment result can be obtained through the fully connected layer network, and the classifier composed of the fully connected layer network classifies the input action feature vector to obtain the output judgment result. What needs to be trained in this disclosure is to use A binary classifier for obtaining judgment results. Through cheap data, a binary classifier with sufficient precision can be obtained, so that the binary classifier, that is, the abnormal behavior recognition network, can be quickly obtained.
步骤513中,丢弃判定结果与标签不符的相似网络数据,降低在接下来训练时,由于与标签不符的相似网络数据导致最终训练出来的二分类器不准确的情况,在需要更新主干网络权重的情况下,丢弃这些相似网络数据还能防止这些相似网络数据带偏主干网络的表征空间,进而防止最终的二分类器被影响。In step 513, the similar network data whose judgment result does not match the label is discarded, so as to reduce the inaccuracy of the final trained binary classifier due to the similar network data inconsistent with the label during the next training, and when it is necessary to update the backbone network weight In some cases, discarding these similar network data can also prevent these similar network data from biasing the representation space of the backbone network, thereby preventing the final binary classifier from being affected.
其中,由于该异常行为识别网络是个二分类器,对应的标签也只有第一标签和第二标签,可以通过任意两个数字来表征判定结果,任意两个数字来表示标签值,在获取的判定结果与对应的标签是否都表示包含特定异常行为,或者是否都表示不包含特定异常行为的情况下,两者是相符的,其余情况,均为判定结果与标签不符。举例来说,针对判定结果,0表示该训练数据为包含特定异常行为的训练数据,1表示该训练数据为不包含特定异常行为的训练数据,0表示第一标签,1表示第二标签,如果判定结果为0,标签为0,根据判定结果和第一标签0表示的含义,可知两者是相符的,如果判定结果为1,标签为0,说明两者是不相符的。Among them, since the abnormal behavior recognition network is a binary classifier, the corresponding labels are only the first label and the second label, and any two numbers can be used to represent the judgment result, and any two numbers can represent the label value. Whether the result and the corresponding label both indicate that a specific abnormal behavior is included, or whether they both indicate that a specific abnormal behavior is not included, the two are consistent, and in the rest of the cases, it is determined that the result and the label do not match. For example, for the judgment result, 0 indicates that the training data contains specific abnormal behavior, 1 indicates that the training data does not contain specific abnormal behavior, 0 indicates the first label, and 1 indicates the second label. If The judgment result is 0, and the label is 0. According to the judgment result and the meaning of the first label 0, it can be seen that the two are consistent. If the judgment result is 1, and the label is 0, it means that the two do not match.
此外,考虑到由于需要丢弃的为相似网络数据,采集数据不能丢弃,因此在丢弃训练数据前,还需要确定该数据是否是相似网络数据。确定是否是相似网络数据的方法,可以是根据预先存储的每个训练数据是否是相似网络数据来判断,也可以基于生成对抗,训练一个判别器,通过该判别器来判断训练数据是否是网络数据。换言之,每次迭代中,在所述针对每个相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃前,所述方法还包括:将每个所述训练数据输入判别器;所述判别器用于判断所述训练数据是否为采集数据;所述针对每个相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃,包括:针对每个训练数据,响应于判别器输出所述训练数据非采集数据,且所述训练数据的判定结果与所述 训练数据的标签不符,则将所述判定结果与所述标签不符的训练数据丢弃。本公开中的实施例,输入的训练数据中无需包含标识是否是采集数据的特征,可以减少异常行为识别网络的复杂度。In addition, considering that the collected data cannot be discarded because the similar network data needs to be discarded, it is necessary to determine whether the data is similar network data before discarding the training data. The method of determining whether it is similar network data can be judged according to whether each pre-stored training data is similar network data, or based on generating confrontation, training a discriminator, and using this discriminator to judge whether the training data is network data . In other words, in each iteration, for each similar network data, if the determination result of the similar network data does not match the label, before discarding the similar network data, the method further includes: The training data is input into a discriminator; the discriminator is used to judge whether the training data is collection data; for each similar network data, if the judgment result of the similar network data does not match the label, the similar network discarding data, including: for each training data, in response to the discriminator outputting that the training data is not collected data, and the judgment result of the training data does not match the label of the training data, then combining the judgment result with the The training data with inconsistent labels are discarded. In the embodiments of the present disclosure, the input training data does not need to include features identifying whether it is collected data, which can reduce the complexity of the abnormal behavior recognition network.
步骤515中,异常行为识别网络的损失可以根据损失函数获取,损失函数为用户预先设置的函数,输入为每个训练数据的判定结果和标签,输出为网络的损失,用于评估异常行为识别网络的好坏。损失函数可以选择二分类器的损失函数。In step 515, the loss of the abnormal behavior recognition network can be obtained according to the loss function, the loss function is a function preset by the user, the input is the judgment result and label of each training data, and the output is the loss of the network, which is used to evaluate the abnormal behavior recognition network good or bad. The loss function can choose the loss function of the binary classifier.
由于本公开中的异常行为识别网络更加关注采集数据的识别结果,因此计算损失时,可以进行加权计算,将采集数据的权重提高,相似网络数据的权重降低。如果获取训练数据时,相似网络数据的数量比采集数据少的情况下,由于所获取的训练数据已经按照一定比例来获取,采集数据对于损失的贡献已经比相似网络数据的损失要大了,计算损失可以不使用加权计算的方法。Since the abnormal behavior recognition network in the present disclosure pays more attention to the recognition results of the collected data, when calculating the loss, weighted calculations can be performed to increase the weight of collected data and reduce the weight of similar network data. If the amount of similar network data is less than the collected data when obtaining training data, since the obtained training data has been obtained according to a certain proportion, the contribution of collected data to the loss is already greater than the loss of similar network data. Calculate Loss can be calculated without weighting.
步骤517中所更新的权重为异常行为识别网络的权重,换言之,更新的是步骤511中所使用的网络(可以是全连接层)的权重,权重跟新可以是根据梯度下降法进行更新,也可以根据其他的权重更新方法进行更新,本公开在此不做限制。The weight updated in step 517 is the weight of the abnormal behavior recognition network, in other words, what is updated is the weight of the network (which can be a fully connected layer) used in step 511, and the weight update can be updated according to the gradient descent method, or The update may be performed according to other weight update methods, which are not limited in the present disclosure.
在一些实施例中,本公开实施例中的异常行为识别网络至少可以包括:主干网络特征提取器、判别器和分类器等多个模块。如图5b所示,图5b为本公开实施例提供的一种迭代方法的示意图。可以将数据集(Dataset)和辅助数据集(Auxiliary Dataset)中的数据输入主干网络特征提取器(Backbone feature extract)501,进行特征提取处理,得到数据集对应的动作特征序列(Motion sequence),以及辅助数据集对应的辅助特征序列(Auxiliary feature sequence)。其中,数据集可以理解为正样本训练数据的集合,辅助数据集可以理解为网络数据的集合,主干网络特征提取器501输出的动作特征或者辅助特征至少可以包括空间特征(Scenario dimension)和时间特征(Time dimension),根据辅助特征序列中各个辅助特征与动作特征序列中各个动作特征之间的相似度,从辅助数据集中确定出负样本训练数据的集合。终端设备可以将正样本训练数据和负样本训练数据作为训练数据,可以将正样本训练数据对应的动作特征,以及负样本训练数据对应的辅助特征输入判别器(Discriminator)502,进行特征判别(Feature Discriminator)处理,判别器502用于判断当前的训练数据是否为采集数据(如,属于采集数据输出为真Real,属于非采集数据输出为假Fake等),其中,终端设备可以通过根据动作特征或者辅助特征所表征的场景(Scene)和动作(动作)类型等因素,来确定当前的奖励(Reward),进而计算特征损失(Feature Loss),来对判别器502配置的权重进行更新。终端设备通过判别器502对训练数据进行筛选后,可以将正样本训练数据对应的动作特征,以及负样本训练数据对应的辅助特征输入分类器503,用于确定训练数据的判定结果,判定结果可以表征训练数据与训练数据的标签是否符合,其中,分类器503可以为全连接层(Fully connected layers,FC)。终端设备针对每个训练数据,响应于判别器502输出训练数据为非采集数据,且分类器503确定非采集数据的判定结果与训练数据的标签不符,则将该训练数据丢弃。终端设备可以根据未被丢弃的训练数据的判定结果以及标签,确 定分类损失(Classification Loss),进而更新异常行为识别网络的权重。In some embodiments, the abnormal behavior recognition network in the embodiments of the present disclosure may at least include multiple modules such as a backbone network feature extractor, a discriminator, and a classifier. As shown in FIG. 5b, FIG. 5b is a schematic diagram of an iterative method provided by an embodiment of the present disclosure. The data in the data set (Dataset) and the auxiliary data set (Auxiliary Dataset) can be input into the backbone network feature extractor (Backbone feature extract) 501, and the feature extraction process is performed to obtain the motion feature sequence (Motion sequence) corresponding to the data set, and Auxiliary feature sequence corresponding to auxiliary dataset. Among them, the data set can be understood as a collection of positive sample training data, and the auxiliary data set can be understood as a collection of network data. The action features or auxiliary features output by the backbone network feature extractor 501 can include at least spatial features (Scenario dimension) and time features. (Time dimension), according to the similarity between each auxiliary feature in the auxiliary feature sequence and each action feature in the action feature sequence, determine the set of negative sample training data from the auxiliary data set. The terminal device can use the positive sample training data and the negative sample training data as training data, and can input the action features corresponding to the positive sample training data and the auxiliary features corresponding to the negative sample training data into the discriminator (Discriminator) 502 to perform feature discrimination (Feature Discriminator), the discriminator 502 is used to judge whether the current training data is collected data (for example, if it belongs to the collected data output, it is Real, if it belongs to non-collected data, it is output as Fake, etc.), wherein, the terminal device can pass according to the action feature or The scene (Scene) represented by the auxiliary feature and the type of action (action) are used to determine the current reward (Reward), and then calculate the feature loss (Feature Loss) to update the weight configured by the discriminator 502. After the terminal device screens the training data through the discriminator 502, the action features corresponding to the positive sample training data and the auxiliary features corresponding to the negative sample training data can be input into the classifier 503 to determine the judgment result of the training data. The judgment result can be Indicating whether the training data matches the label of the training data, wherein the classifier 503 may be a fully connected layer (Fully connected layers, FC). For each training data, the terminal device discards the training data in response to the discriminator 502 outputting that the training data is non-collection data, and the classifier 503 determines that the judgment result of the non-collection data does not match the label of the training data. The terminal device can determine the classification loss (Classification Loss) according to the judgment result and label of the training data that has not been discarded, and then update the weight of the abnormal behavior recognition network.
本公开实施例中,可以通过获取已有的网络数据(已标注或无标注的),例如:通过引用其他大量的视频数据库等,可以在不增加异常行为识别网络大小或复杂度的情况下,训练得到更准确的异常行为识别网络,提高异常行为识别网络的鲁棒性。例如:异常行为识别网络可以引用外部无标注的网络数据或者有标注的网络公开的数据集,检索与采集数据之间的相似度相近的网络数据,进而可以提高异常行为识别网络的训练效率,以使得异常行为识别网络能够在不使用数以十亿的参数情况下,通过少量的采集数据使得训练结果良好,并可以在短时间内启动异常行为识别任务。本公开实施例中,可以通过不同数据之间的相似度来表示数据之间的联系,实现异常行为识别网络从大量的公开数据或网络数据中检索与采集数据相关联的相似网络数据,共同训练异常行为识别网络。In the embodiment of the present disclosure, by obtaining existing network data (labeled or unlabeled), for example: by referring to other large video databases, etc., without increasing the size or complexity of the abnormal behavior identification network, Train to obtain a more accurate abnormal behavior recognition network and improve the robustness of the abnormal behavior recognition network. For example, the abnormal behavior recognition network can refer to the external unlabeled network data or the public datasets of the marked network, and retrieve the network data with similar similarity with the collected data, which can improve the training efficiency of the abnormal behavior recognition network. It enables the abnormal behavior recognition network to achieve good training results through a small amount of collected data without using billions of parameters, and can start the abnormal behavior recognition task in a short time. In the embodiment of the present disclosure, the connection between data can be represented by the similarity between different data, and the abnormal behavior recognition network can retrieve similar network data associated with the collected data from a large amount of public data or network data, and jointly train Abnormal behavior recognition network.
此外,上述实施例中,只是针对一个特定异常行为的异常行为识别网络进行说明,在同时需要训练多个针对不同异常行为的异常行为识别网络的情况下,多个网络可以同时进行训练,共用同一个主干网络,各个异常行为识别网络的权重根据各自网络的损失进行更新,主干网络的权重根据所有异常行为识别网络的损失进行更新。这样,提升了训练效率。In addition, in the above-mentioned embodiment, only the abnormal behavior recognition network for a specific abnormal behavior is described. In the case that multiple abnormal behavior recognition networks for different abnormal behaviors need to be trained at the same time, multiple networks can be trained at the same time, sharing the same network. A backbone network, the weights of each abnormal behavior recognition network are updated according to the losses of their respective networks, and the weights of the backbone network are updated according to the losses of all abnormal behavior recognition networks. In this way, the training efficiency is improved.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本公开不再赘述。The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments, the same or similar points can be referred to each other, and for the sake of brevity, the present disclosure will not repeat them.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above-mentioned method of specific implementation, the writing order of each step does not imply a strict execution order and constitutes any limitation on the implementation process, and the execution order of each step should be based on its function and possible internal Logically OK.
与前述训练数据获取方法和异常行为识别网络训练方法的实施例相对应,本公开还提供了训练数据获取装置、异常行为识别网络训练装置及其所应用的终端的实施例。Corresponding to the aforementioned embodiments of the training data acquisition method and the abnormal behavior recognition network training method, the present disclosure also provides embodiments of the training data acquisition device, the abnormal behavior recognition network training device and the terminal to which they are applied.
如图6所示,图6为本公开实施例提供的一种训练数据获取装置的框图,所述装置包括:As shown in FIG. 6, FIG. 6 is a block diagram of a training data acquisition device provided by an embodiment of the present disclosure, and the device includes:
数据获取模块610,配置为获取网络数据,及包含特定异常行为的采集数据。The data acquisition module 610 is configured to acquire network data and collected data including specific abnormal behaviors.
动作特征获取模块620,配置为获取每个所述网络数据的动作特征及每个所述采集数据的动作特征。The action feature acquisition module 620 is configured to acquire the action features of each of the network data and the action features of each of the collected data.
训练数据选取模块630,配置为根据每个所述网络数据的动作特征与每个采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。The training data selection module 630 is configured to select similar network data matching the collected data from the network data according to the similarity between the action features of each of the network data and the action features of each collected data, The collected data and the similar network data are used as positive sample training data for specific abnormal behaviors.
在一些实施方式中,所述网络数据包括以下至少之一:互联网公开的数据集;网络爬虫数据;基于虚拟游戏引擎生成的数据。这样的网络数据更加全面,使得训练数据更加多样。In some embodiments, the network data includes at least one of the following: data sets published on the Internet; web crawler data; data generated based on a virtual game engine. Such network data is more comprehensive, making the training data more diverse.
在一些实施方式中,数据获取模块610,包括:第一获取子模块,配置为获取主干 网络;提取子模块,配置为通过所述主干网络,提取每个所述采集数据的动作特征;第二获取子模块,配置为获取预先存储的通过所述主干网络所提取的每个所述网络数据的动作特征。通过主干网络,可以获取到采集数据的动作特征,并且预先提取了网络数据的动作特征,在面对多个异常行为训练的要求时,无需获取多次网络数据的动作特征,提高了训练效率。In some implementations, the data acquisition module 610 includes: a first acquisition submodule configured to acquire a backbone network; an extraction submodule configured to extract the action feature of each of the collected data through the backbone network; the second The acquisition submodule is configured to acquire the pre-stored action features of each of the network data extracted through the backbone network. Through the backbone network, the action features of the collected data can be obtained, and the action features of the network data are pre-extracted. When faced with the requirements of multiple abnormal behavior training, there is no need to obtain the action features of the network data multiple times, which improves the training efficiency.
在一些实施方式中,训练数据选取模块630,包括:合成子模块,配置为根据所有所述采集数据的动作特征,合成采集数据中心特征;第一选取子模块,配置为根据每个所述网络数据的动作特征与所述采集数据中心特征之间的相似度,选取与所述采集数据匹配的相似网络数据。这样,将所有采集数据的动作特征合成为中心特征,中心特征更能反映该异常行为的特点,选取的相似网络数据更为准确。In some implementations, the training data selection module 630 includes: a synthesis submodule configured to synthesize the features of the collected data centers according to the action features of all the collected data; a first selection submodule configured to combine The similarity between the action feature of the data and the feature of the collected data center is to select similar network data that matches the collected data. In this way, the action features of all collected data are synthesized into a central feature, which can better reflect the characteristics of the abnormal behavior, and the selected similar network data is more accurate.
在一些实施方式中,训练数据选取模块630,包括:确定子模块,配置为根据预设数量比例,及所述采集数据的数量,确定需要采集的相似网络数据的数量N;第二选取子模块,配置为从所述网络数据中,选取N个相似网络数据;其中,任一所述相似网络数据的动作特征与采集数据的动作特征之间的相似度,不小于网络数据中未被选取的任一所述网络数据的动作特征与采集数据的动作特征之间的相似度。这样,所选择的相似网络数据和采集数据比例满足一定条件,使得异常行为识别网络不会被相似网络数据带偏,针对采集数据有较好的效果。In some embodiments, the training data selection module 630 includes: a determination submodule configured to determine the number N of similar network data to be collected according to the preset number ratio and the quantity of collected data; the second selection submodule , configured to select N similar network data from the network data; wherein, the similarity between the action features of any of the similar network data and the action features of the collected data is not less than that of the unselected network data The similarity between any action feature of the network data and the action feature of the collected data. In this way, the proportion of the selected similar network data and collected data satisfies certain conditions, so that the abnormal behavior recognition network will not be biased by similar network data, and has a better effect on collected data.
如图7所示,图7为本公开实施例提供的一种异常行为识别网络训练装置的框图,所述装置包括:As shown in FIG. 7, FIG. 7 is a block diagram of an abnormal behavior recognition network training device provided by an embodiment of the present disclosure, and the device includes:
训练数据获取模块710,配置为获取训练数据,所述训练数据包括正样本训练数据和负样本训练数据,所述正样本训练数据基于上述的训练样本获取方法所获取。The training data obtaining module 710 is configured to obtain training data, the training data includes positive sample training data and negative sample training data, and the positive sample training data is obtained based on the above-mentioned training sample obtaining method.
网络训练模块720,配置为通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。The network training module 720 is configured to iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset times threshold.
在一些实施方式中,所述正样本训练数据包括第一标签,所述负样本训练数据包括第二标签。网络训练模块720,包括:第三获取子模块,配置为在每次迭代的过程中,获取每个所述训练数据的判定结果;所述判定结果用于表征所述训练数据是否包括所述特定异常行为;丢弃子模块,配置为针对每个相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃;第四获取子模块,配置为根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失;第一更新子模块,配置为根据所述异常行为识别网络输出的损失,更新所述异常行为识别网络的权重。这样,丢弃了和采集数据并不相似的相似网络数据,降低了异常行为识别网络被这些数据所带偏的可能。In some implementations, the positive sample training data includes a first label, and the negative sample training data includes a second label. The network training module 720 includes: a third acquisition submodule, configured to acquire a determination result of each of the training data during each iteration; the determination result is used to represent whether the training data includes the specific Abnormal behavior; the discarding submodule is configured to discard the similar network data for each similar network data if the determination result of the similar network data does not match the label; the fourth acquisition submodule is configured to The judgment result and label of the training data to obtain the loss output by the abnormal behavior recognition network; the first update submodule is configured to update the weight of the abnormal behavior recognition network according to the loss output by the abnormal behavior recognition network. In this way, similar network data that are not similar to the collected data are discarded, reducing the possibility that the abnormal behavior recognition network is biased by these data.
在一些实施方式中,所述装置还包括:第五获取子模块,配置为根据主干网络,获取每个所述训练数据的动作特征;所述动作特征用于判定所述训练数据是否包括所述特定异常行为;第六获取子模块,配置为所述根据未被丢弃的训练数据的判定结果和标签, 获得所述异常行为识别网络输出的损失后,所述装置还包括:第二更新子模块,配置为根据所述损失,更新所述主干网络的权重。这样,通过更新主干网络,使得主干网络的更能提取出异常行为的特点,提高了异常行为识别网络的准确度。In some embodiments, the device further includes: a fifth acquisition submodule configured to acquire the action feature of each of the training data according to the backbone network; the action feature is used to determine whether the training data includes the Specific abnormal behavior; the sixth acquisition submodule is configured to obtain the output loss of the abnormal behavior recognition network according to the judgment result and label of the training data that has not been discarded, and the device also includes: a second update submodule , configured to update the weights of the backbone network according to the loss. In this way, by updating the backbone network, the backbone network can better extract the characteristics of abnormal behavior, and improve the accuracy of the abnormal behavior recognition network.
在一些实施方式中,所述装置还包括:输入子模块,配置为将每个所述训练数据输入判别器;所述判别器用于判断所述训练数据是否为采集数据。所述丢弃子模块,包括:响应单元,配置为针对每个训练数据,响应于判别器输出所述训练数据非采集数据,且所述训练数据的判定结果与所述训练数据的标签不符,则将所述判定结果与所述标签不符的训练数据丢弃。这样,输入的训练数据中无需包含标识是否是采集数据的特征,减少了模型的复杂度。In some embodiments, the device further includes: an input submodule configured to input each of the training data into a discriminator; the discriminator is used to judge whether the training data is collected data. The discarding submodule includes: a response unit configured to, for each training data, respond to the discriminator outputting that the training data is not collected data, and the judgment result of the training data does not match the label of the training data, then Discarding the training data whose determination result does not match the label. In this way, the input training data does not need to include features identifying whether it is the collected data, which reduces the complexity of the model.
上述装置中各个模块的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and effects of each module in the above-mentioned device, please refer to the implementation process of the corresponding steps in the above-mentioned method for details, and details will not be repeated here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in One place, or it can be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. It can be understood and implemented by those skilled in the art without creative effort.
如图8所示,图8示出了上述装置所在计算机设备的一种硬件结构图,该计算机设备可以只包括训练数据获取装置,也可以只包括异常行为识别网络训练装置,还可以包括训练数据获取装置和异常行为识别网络训练装置。该设备可以包括:处理器810、存储器820、输入/输出接口830、通信接口840和总线80。其中处理器810、存储器820、输入/输出接口830和通信接口840通过总线850实现彼此之间在设备内部的通信连接。As shown in Figure 8, Figure 8 shows a hardware structure diagram of the computer equipment where the above-mentioned device is located, the computer equipment may only include the training data acquisition device, may also only include the abnormal behavior recognition network training device, and may also include the training data An acquisition device and an abnormal behavior identification network training device. The device may include: a processor 810 , a memory 820 , an input/output interface 830 , a communication interface 840 and a bus 80 . The processor 810 , the memory 820 , the input/output interface 830 and the communication interface 840 are connected to each other within the device through the bus 850 .
处理器810可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本公开实施例所提供的部分或全部技术方案。The processor 810 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related programs to realize part or all of the technical solutions provided by the embodiments of the present disclosure.
存储器820可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器820可以存储操作系统和其他应用程序,在通过软件或者固件来实现本公开实施例所提供的技术方案时,相关的程序代码保存在存储器820中,并由处理器810来调用执行。The memory 820 can be implemented in the form of ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, and the like. The memory 820 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of the present disclosure through software or firmware, the relevant program codes are stored in the memory 820 and invoked by the processor 810 for execution.
输入/输出接口830用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 830 is used to connect the input/output module to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
通信接口840用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无 线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 840 is used to connect a communication module (not shown in the figure), so as to realize communication interaction between the device and other devices. The communication module can realize communication through wired methods (such as USB, network cable, etc.), and can also realize communication through wireless methods (such as mobile network, WIFI, Bluetooth, etc.).
总线850包括一通路,在设备的各个组件(例如处理器810、存储器820、输入/输出接口830和通信接口840)之间传输信息。 Bus 850 includes a path for carrying information between the various components of the device (eg, processor 810, memory 820, input/output interface 830, and communication interface 840).
需要说明的是,尽管上述设备仅示出了处理器810、存储器820、输入/输出接口830、通信接口840以及总线850,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本公开实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the processor 810, the memory 820, the input/output interface 830, the communication interface 840 and the bus 850, in the specific implementation process, the device may also include other components. In addition, those skilled in the art can understand that the above-mentioned device may only include components necessary to realize the solutions of the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述的训练数据获取方法或异常行为识别网络训练方法。其中,该计算机可读存储介质可以只存储训练数据集获取方法对应的计算机程序,也可以只存储异常行为识别网络训练方法对应的计算机程序。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above-mentioned training data acquisition method or abnormal behavior identification network training method is implemented. Wherein, the computer-readable storage medium may only store the computer program corresponding to the training data set acquisition method, or may only store the computer program corresponding to the abnormal behavior recognition network training method.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备,可为易失性存储介质或者非易失性存储介质。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device, and may be a volatile storage medium or a nonvolatile storage medium. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
本公开实施例还提出一种计算机程序,所述计算机程序包括计算机可读代码,在所述计算机可读代码被计算机读取并执行的情况下,实现本公开任一实施例中的方法的部分或全部步骤。An embodiment of the present disclosure also proposes a computer program, the computer program includes computer readable code, and when the computer readable code is read and executed by a computer, part of the method in any embodiment of the present disclosure is implemented or all steps.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法的部分或全部步骤。An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes some or all steps of the above method.
本领域技术人员在考虑公开及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。公开和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the disclosure and practice of the invention disclosed herein. The present disclosure is intended to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. . The disclosure and examples are to be considered exemplary only, with the true scope and spirit of the disclosure indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
以上所述仅为本公开的较佳实施例而已,并不用以限制本公开,凡在本公开的精神 和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开保护的范围之内。The above descriptions are only preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the present disclosure within the scope of protection.

Claims (22)

  1. 一种训练数据获取方法,所述方法包括:A training data acquisition method, the method comprising:
    获取网络数据,及包含特定异常行为的采集数据;Obtain network data and collected data containing specific abnormal behaviors;
    获取每个所述网络数据的动作特征及每个所述采集数据的动作特征;Obtaining an action feature of each of the network data and an action feature of each of the collected data;
    根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。According to the similarity between the action features of each of the network data and the action features of each of the collected data, select similar network data that matches the collected data from the network data, and store the collected data And the similar network data are used as positive sample training data for specific abnormal behaviors.
  2. 根据权利要求1所述的方法,其中,所述网络数据包括以下至少之一:The method according to claim 1, wherein the network data includes at least one of the following:
    互联网公开的数据集;网络爬虫数据;基于虚拟游戏引擎生成的数据。Data sets exposed on the Internet; web crawler data; data generated based on virtual game engines.
  3. 根据权利要求1-2任一项所述的方法,其中,所述获取每个所述网络数据的动作特征及每个所述采集数据的动作特征,包括:The method according to any one of claims 1-2, wherein said obtaining the action features of each of said network data and the action features of each of said collected data comprises:
    获取主干网络;Get the backbone network;
    通过所述主干网络,提取每个所述采集数据的动作特征;extracting action features of each of the collected data through the backbone network;
    获取预先存储的通过所述主干网络所提取的每个所述网络数据的动作特征。Acquiring pre-stored action features of each of the network data extracted through the backbone network.
  4. 根据权利要求1-3任一项所述的方法,其中,所述根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,包括:The method according to any one of claims 1-3, wherein, according to the similarity between the action features of each of the network data and the action features of each of the collected data, from the network data Select similar network data that matches the collected data, including:
    根据所有所述采集数据的动作特征,合成采集数据中心特征;Synthesizing the collected data center features according to the action features of all the collected data;
    根据每个所述网络数据的动作特征与所述采集数据中心特征之间的相似度,选取与所述采集数据匹配的相似网络数据。According to the similarity between the action features of each of the network data and the features of the collected data centers, similar network data matching the collected data are selected.
  5. 根据权利要求1-4任一项所述的方法,其中,所述根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,包括:The method according to any one of claims 1-4, wherein, according to the similarity between the action features of each of the network data and the action features of each of the collected data, from the network data Select similar network data that matches the collected data, including:
    根据预设数量比例,及所述采集数据的数量,确定需要采集的所述相似网络数据的数量N;Determine the quantity N of the similar network data to be collected according to the preset quantity ratio and the quantity of the collected data;
    从所述网络数据中,选取N个所述相似网络数据;其中,任一所述相似网络数据的动作特征与所述采集数据的动作特征之间的相似度,不小于所述网络数据中未被选取的任一所述网络数据的动作特征与所述采集数据的动作特征之间的相似度。From the network data, select N pieces of similar network data; wherein, the similarity between the action features of any of the similar network data and the action features of the collected data is not less than that of none of the network data The similarity between the action features of any selected network data and the action features of the collected data.
  6. 一种异常行为识别网络训练方法,所述方法包括:A network training method for abnormal behavior recognition, said method comprising:
    获取训练数据,所述训练数据包括正样本训练数据和负样本训练数据,所述正样本训练数据基于权利要求1-5任一项的方法所获取;Obtain training data, the training data includes positive sample training data and negative sample training data, the positive sample training data is obtained based on the method of any one of claims 1-5;
    通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至所述异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。The abnormal behavior recognition network is iteratively trained through the positive sample training data and the negative sample training data until the output loss of the abnormal behavior recognition network is less than a preset first loss threshold, or the number of iterations is greater than a preset threshold.
  7. 根据权利要求6所述的方法,其中,所述正样本训练数据包括第一标签,所 述负样本训练数据包括第二标签;The method of claim 6, wherein the positive sample training data includes a first label, and the negative sample training data includes a second label;
    所述通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,包括:The iterative training of the abnormal behavior recognition network through the positive sample training data and the negative sample training data includes:
    在每次迭代的过程中,获取每个所述训练数据的判定结果;所述判定结果用于表征所述训练数据是否包括所述特定异常行为;During each iteration, a determination result of each of the training data is obtained; the determination result is used to characterize whether the training data includes the specific abnormal behavior;
    针对每个所述相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃;For each of the similar network data, if the determination result of the similar network data does not match the label, discarding the similar network data;
    根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失;Obtaining the loss output by the abnormal behavior recognition network according to the judgment result and label of the training data not discarded;
    根据所述异常行为识别网络输出的损失,更新所述异常行为识别网络的权重。The weights of the abnormal behavior recognition network are updated according to the output loss of the abnormal behavior recognition network.
  8. 根据权利要求6或7所述的方法,其中,所述在每次迭代的过程中,获取每个所述训练数据的判定结果前,所述方法还包括:The method according to claim 6 or 7, wherein, in the process of each iteration, before obtaining the determination result of each of the training data, the method further comprises:
    根据所述主干网络,获取每个所述训练数据的动作特征;所述动作特征用于判定所述训练数据是否包括所述特定异常行为;Acquiring action features of each of the training data according to the backbone network; the action features are used to determine whether the training data includes the specific abnormal behavior;
    所述根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失后,所述方法还包括:After obtaining the loss output by the abnormal behavior recognition network according to the judgment result and label of the undiscarded training data, the method further includes:
    根据所述损失,更新所述主干网络的权重。According to the loss, the weight of the backbone network is updated.
  9. 根据权利要求6-8任一项所述的方法,其中,所述针对每个所述相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃前,所述方法还包括:The method according to any one of claims 6-8, wherein, for each of the similar network data, if the determination result of the similar network data does not match the label, before discarding the similar network data, The method also includes:
    将每个所述训练数据输入判别器;所述判别器用于判断所述训练数据是否为所述采集数据;Each of the training data is input into a discriminator; the discriminator is used to judge whether the training data is the collected data;
    所述针对每个所述相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃,包括:For each of the similar network data, if the determination result of the similar network data does not match the label, then discarding the similar network data, including:
    针对每个所述训练数据,响应于所述判别器输出所述训练数据非采集数据,且所述训练数据的判定结果与所述训练数据的标签不符,则将所述判定结果与所述标签不符的训练数据丢弃。For each of the training data, in response to the discriminator outputting that the training data is not collected data, and the judgment result of the training data does not match the label of the training data, the judgment result and the label Inconsistent training data is discarded.
  10. 一种训练数据获取装置,所述装置包括:A training data acquisition device, said device comprising:
    数据获取模块,配置为获取网络数据,及包含特定异常行为的采集数据;A data acquisition module configured to acquire network data and collected data containing specific abnormal behaviors;
    动作特征获取模块,配置为获取每个所述网络数据的动作特征及每个所述采集数据的动作特征;An action feature acquisition module configured to acquire an action feature of each of the network data and an action feature of each of the collected data;
    训练数据选取模块,配置为根据每个所述网络数据的动作特征与每个所述采集数据的动作特征之间的相似度,从所述网络数据中选取与所述采集数据匹配的相似网络数据,并将所述采集数据及所述相似网络数据作为针对特定异常行为的正样本训练数据。The training data selection module is configured to select similar network data matching the collected data from the network data according to the similarity between the action features of each of the network data and the action features of each of the collected data , and use the collected data and the similar network data as positive sample training data for specific abnormal behaviors.
  11. 根据权利要求10所述的装置,其中,所述网络数据包括以下至少之一:The device according to claim 10, wherein the network data includes at least one of the following:
    互联网公开的数据集;网络爬虫数据;基于虚拟游戏引擎生成的数据。Data sets exposed on the Internet; web crawler data; data generated based on virtual game engines.
  12. 根据权利要求10-11任一项所述的装置,其中,所述动作特征获取模块,包括:The device according to any one of claims 10-11, wherein the action feature acquisition module includes:
    第一获取子模块,配置为获取主干网络;The first acquisition sub-module is configured to acquire the backbone network;
    提取子模块,配置为通过所述主干网络,提取每个所述采集数据的动作特征;The extraction submodule is configured to extract the action feature of each of the collected data through the backbone network;
    第二获取子模块,配置为获取预先存储的通过所述主干网络所提取的每个所述网络数据的动作特征。The second obtaining submodule is configured to obtain the pre-stored action feature of each of the network data extracted through the backbone network.
  13. 根据权利要求10-12任一项所述的装置,其中,所述训练数据选取模块,包括:The device according to any one of claims 10-12, wherein the training data selection module includes:
    合成子模块,配置为根据所有所述采集数据的动作特征,合成采集数据中心特征;The synthesis sub-module is configured to synthesize the collected data center features according to the action features of all the collected data;
    第一选取子模块,配置为根据每个所述网络数据的动作特征与所述采集数据中心特征之间的相似度,选取与所述采集数据匹配的相似网络数据。The first selection submodule is configured to select similar network data matching the collected data according to the similarity between the action feature of each of the network data and the collected data center feature.
  14. 根据权利要求10-13任一项所述的装置,其中,所述训练数据选取模块,包括:The device according to any one of claims 10-13, wherein the training data selection module includes:
    确定子模块,配置为根据预设数量比例,及所述采集数据的数量,确定需要采集的所述相似网络数据的数量N;The determining submodule is configured to determine the quantity N of the similar network data to be collected according to the preset quantity ratio and the quantity of the collected data;
    第二选取子模块,配置为从所述网络数据中,选取N个所述相似网络数据;其中,任一所述相似网络数据的动作特征与所述采集数据的动作特征之间的相似度,不小于所述网络数据中未被选取的任一所述网络数据的动作特征与所述采集数据的动作特征之间的相似度。The second selection submodule is configured to select N pieces of similar network data from the network data; wherein, the similarity between the action features of any of the similar network data and the action features of the collected data, Not less than the similarity between the action features of any unselected network data in the network data and the action features of the collected data.
  15. 一种异常行为识别网络训练装置,所述装置包括:A network training device for abnormal behavior recognition, said device comprising:
    训练数据获取模块,配置为获取训练数据,所述训练数据包括正样本训练数据和负样本训练数据,所述正样本训练数据基于权利要求1-5任一项的方法所获取;A training data acquisition module configured to acquire training data, the training data comprising positive sample training data and negative sample training data, the positive sample training data being obtained based on the method of any one of claims 1-5;
    网络训练模块,配置为通过所述正样本训练数据和所述负样本训练数据迭代训练异常行为识别网络,直至所述异常行为识别网络输出的损失小于预设第一损失阈值,或迭代次数大于预设次数阈值。The network training module is configured to iteratively train the abnormal behavior recognition network through the positive sample training data and the negative sample training data until the loss output by the abnormal behavior recognition network is less than the preset first loss threshold, or the number of iterations is greater than the preset Set the count threshold.
  16. 根据权利要求15所述的装置,其中,所述正样本训练数据包括第一标签,所述负样本训练数据包括第二标签;The apparatus of claim 15, wherein the positive sample training data includes a first label, and the negative sample training data includes a second label;
    所述网络训练模块,包括:The network training module includes:
    第三获取子模块,配置为在每次迭代的过程中,获取每个所述训练数据的判定结果;所述判定结果用于表征所述训练数据是否包括所述特定异常行为;The third acquisition submodule is configured to acquire a determination result of each of the training data during each iteration; the determination result is used to represent whether the training data includes the specific abnormal behavior;
    丢弃子模块,配置为针对每个所述相似网络数据,若所述相似网络数据的判定结果与标签不符,则将所述相似网络数据丢弃;The discarding submodule is configured to, for each of the similar network data, discard the similar network data if the determination result of the similar network data does not match the label;
    第四获取子模块,配置为根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失;The fourth acquisition sub-module is configured to obtain the loss output by the abnormal behavior identification network according to the judgment result and label of the training data that has not been discarded;
    第一更新子模块,配置为根据所述异常行为识别网络输出的损失,更新所述异常 行为识别网络的权重。The first update submodule is configured to update the weight of the abnormal behavior recognition network according to the output loss of the abnormal behavior recognition network.
  17. 根据权利要求15或16所述的装置,其中,所述第三获取子模块前,所述装置还包括:The device according to claim 15 or 16, wherein, before the third acquiring submodule, the device further comprises:
    第五获取子模块,配置为根据所述主干网络,获取每个所述训练数据的动作特征;所述动作特征用于判定所述训练数据是否包括所述特定异常行为;The fifth acquisition submodule is configured to acquire the action feature of each of the training data according to the backbone network; the action feature is used to determine whether the training data includes the specific abnormal behavior;
    第六获取子模块,配置为所述根据未被丢弃的训练数据的判定结果和标签,获得所述异常行为识别网络输出的损失后,所述装置还包括:The sixth acquisition sub-module is configured to obtain the output loss of the abnormal behavior recognition network according to the judgment result and label of the training data that has not been discarded, and the device further includes:
    第二更新子模块,配置为根据所述损失,更新所述主干网络的权重。The second update submodule is configured to update the weight of the backbone network according to the loss.
  18. 根据权利要求15-17任一项所述的装置,其中,所述丢弃子模块前,所述装置还包括:The device according to any one of claims 15-17, wherein, before the discarding submodule, the device further comprises:
    输入子模块,配置为将每个所述训练数据输入判别器;所述判别器用于判断所述训练数据是否为所述采集数据;The input sub-module is configured to input each of the training data into a discriminator; the discriminator is used to judge whether the training data is the collected data;
    所述丢弃子模块,包括:The discarding submodule includes:
    响应单元,配置为针对每个所述训练数据,响应于所述判别器输出所述训练数据非采集数据,且所述训练数据的判定结果与所述训练数据的标签不符,则将所述判定结果与所述标签不符的训练数据丢弃。The response unit is configured to, for each of the training data, respond to the discriminator outputting that the training data is not collected data, and the determination result of the training data does not match the label of the training data, then the determination As a result, training data that does not match the label is discarded.
  19. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至9中任一项所述的方法。A computer-readable storage medium storing a computer program, and implementing the method according to any one of claims 1 to 9 when the computer program is executed by a processor.
  20. 一种计算机设备,所述计算机设备包括:A computer device comprising:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;memory for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1至9中任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-9.
  21. 一种计算机程序,包括计算机可读代码,在计算机可读代码在设备上运行的情况下,设备中的处理器执行用于实现权利要求1至9中任一所述的方法。A computer program comprising computer readable codes, in case the computer readable codes run on the device, the processor in the device executes the method for implementing any one of claims 1 to 9.
  22. 一种计算机程序产品,配置为存储计算机可读指令,所述计算机可读指令被执行时使得计算机执行权利要求1至9中任一所述的方法。A computer program product configured to store computer-readable instructions that, when executed, cause a computer to perform the method of any one of claims 1-9.
PCT/CN2022/077716 2021-08-30 2022-02-24 Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product WO2023029397A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111006832.0 2021-08-30
CN202111006832.0A CN113705689A (en) 2021-08-30 2021-08-30 Training data acquisition method and abnormal behavior recognition network training method

Publications (1)

Publication Number Publication Date
WO2023029397A1 true WO2023029397A1 (en) 2023-03-09

Family

ID=78657004

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077716 WO2023029397A1 (en) 2021-08-30 2022-02-24 Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product

Country Status (2)

Country Link
CN (1) CN113705689A (en)
WO (1) WO2023029397A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473273A (en) * 2023-12-27 2024-01-30 宁德时代新能源科技股份有限公司 Abnormality detection method, abnormality detection device, abnormality detection terminal, and computer-readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705689A (en) * 2021-08-30 2021-11-26 上海商汤智能科技有限公司 Training data acquisition method and abnormal behavior recognition network training method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368934A (en) * 2020-03-17 2020-07-03 腾讯科技(深圳)有限公司 Image recognition model training method, image recognition method and related device
CN111931713A (en) * 2020-09-21 2020-11-13 成都睿沿科技有限公司 Abnormal behavior detection method and device, electronic equipment and storage medium
CN112287857A (en) * 2020-11-03 2021-01-29 北京享云智汇科技有限公司 Multi-view abnormal gait recognition method
CN113705689A (en) * 2021-08-30 2021-11-26 上海商汤智能科技有限公司 Training data acquisition method and abnormal behavior recognition network training method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368934A (en) * 2020-03-17 2020-07-03 腾讯科技(深圳)有限公司 Image recognition model training method, image recognition method and related device
CN111931713A (en) * 2020-09-21 2020-11-13 成都睿沿科技有限公司 Abnormal behavior detection method and device, electronic equipment and storage medium
CN112287857A (en) * 2020-11-03 2021-01-29 北京享云智汇科技有限公司 Multi-view abnormal gait recognition method
CN113705689A (en) * 2021-08-30 2021-11-26 上海商汤智能科技有限公司 Training data acquisition method and abnormal behavior recognition network training method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473273A (en) * 2023-12-27 2024-01-30 宁德时代新能源科技股份有限公司 Abnormality detection method, abnormality detection device, abnormality detection terminal, and computer-readable storage medium
CN117473273B (en) * 2023-12-27 2024-05-28 宁德时代新能源科技股份有限公司 Abnormality detection method, abnormality detection device, abnormality detection terminal, and computer-readable storage medium

Also Published As

Publication number Publication date
CN113705689A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
US11637797B2 (en) Automated image processing and content curation
CN110781276B (en) Text extraction method, device, equipment and storage medium
WO2020232861A1 (en) Named entity recognition method, electronic device and storage medium
CN111062871B (en) Image processing method and device, computer equipment and readable storage medium
JP6402653B2 (en) Object recognition device, object recognition method, and program
WO2017045443A1 (en) Image retrieval method and system
WO2023029397A1 (en) Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product
WO2021160157A1 (en) Group display method and device
CN113254643B (en) Text classification method and device, electronic equipment and text classification program
JP2021111367A (en) Automatic parameter-value solution for api evaluation
CN115443490A (en) Image auditing method and device, equipment and storage medium
CN110427542A (en) Sorter network training and data mask method and device, equipment, medium
CN111783712A (en) Video processing method, device, equipment and medium
CN111984749A (en) Method and device for ordering interest points
CN108241690A (en) A kind of data processing method and device, a kind of device for data processing
CN113140012B (en) Image processing method, device, medium and electronic equipment
CN114385812A (en) Relation extraction method and system for text
CN113919361A (en) Text classification method and device
CN114091551A (en) Pornographic image identification method and device, electronic equipment and storage medium
CN111259975B (en) Method and device for generating classifier and method and device for classifying text
CN117573900A (en) Question searching method, question searching algorithm training device, electronic equipment and medium
CN116956015A (en) Data screening method, device, equipment and storage medium
CN114153954A (en) Test case recommendation method and device, electronic equipment and storage medium
CN114972893A (en) Data labeling method and device, electronic equipment and storage medium
CN111460206B (en) Image processing method, apparatus, electronic device, and computer-readable storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE