WO2023137915A1 - 基于特征融合的行为识别方法、装置、设备及存储介质 - Google Patents

基于特征融合的行为识别方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023137915A1
WO2023137915A1 PCT/CN2022/090714 CN2022090714W WO2023137915A1 WO 2023137915 A1 WO2023137915 A1 WO 2023137915A1 CN 2022090714 W CN2022090714 W CN 2022090714W WO 2023137915 A1 WO2023137915 A1 WO 2023137915A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
feature extraction
input
module
branch
Prior art date
Application number
PCT/CN2022/090714
Other languages
English (en)
French (fr)
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 WO2023137915A1 publication Critical patent/WO2023137915A1/zh

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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions

Definitions

  • This application relates to the field of artificial intelligence, and provides a behavior recognition method, device, equipment and storage medium based on feature fusion.
  • Action recognition is a topic in the field of computer vision recognition.
  • Video can be decomposed into two parts: space dimension information and time dimension information.
  • the spatial dimension information is expressed in the form of a single image, which carries static information such as the shape and color of the target.
  • the time dimension information is displayed through multiple frames of continuous images, reflecting the movement information of the target object.
  • the spatial dimension information and time dimension information of the image are processed separately and then fused, which can realize the combination of static information and dynamic information of the target object.
  • the way of combining the static information and dynamic information of the target object through separate processing and fusion of the spatial dimension information and the time dimension information of the image through two neural networks has problems such as difficult training of the model, too complicated algorithm, and inaccurate feature extraction leading to low accuracy of behavior recognition and low training efficiency of the model.
  • the embodiment of the present application provides a behavior recognition method based on feature fusion, including:
  • each of the frame images For each of the frame images, acquiring color information and optical flow information of the frame images, and fusing the color information and the optical flow information of each pixel of the frame images to obtain a fused image;
  • the fused image is input to the feature extraction network for feature extraction to obtain target features
  • the feature extraction network includes a first branch, a second branch and a fusion module
  • the first branch is used to extract the first feature representing the time dimension information of the input video
  • the second branch is used to extract the second feature representing the spatial dimension information of the input video
  • the fusion module is used to fuse the first feature and the second feature to obtain the target feature
  • the first branch includes N first feature extraction modules
  • the second branch includes N second feature extraction modules.
  • the input of the nth first feature extraction module is the n-1th.
  • the output of the first feature extraction module, the input of the nth described second feature extraction module is the fusion result of the output of the n-1th described first feature extraction module and the output of the n-1th described second feature extraction module, N is an integer greater than or equal to 2, and n is an integer between 2 and N;
  • the target features are classified to obtain a behavior recognition result.
  • the embodiment of the present application also provides a behavior recognition device based on feature fusion, including:
  • a frame extraction module is used to extract frames from the input video to obtain frame images
  • a fused image acquisition module configured to acquire color information and optical flow information of the frame image for each frame image, and fuse the color information and the optical flow information of each pixel of the frame image to obtain a fused image
  • the feature extraction module is used to input the fused image to the feature extraction network for feature extraction to obtain target features
  • the feature extraction network includes a first branch, a second branch and a fusion module
  • the first branch is used to extract the first feature representing the time dimension information of the input video
  • the second branch is used to extract the second feature representing the spatial dimension information of the input video
  • the fusion module is used to fuse the first feature and the second feature to obtain the target feature
  • the first branch includes N first feature extraction modules
  • the second branch includes N second feature extraction modules
  • the nth input of the first feature extraction module It is the output of the n-1th described first feature extraction module
  • the input of the n-th described second feature extraction module is the output of the n-1th described first feature extraction module and the output of the n-1th described second feature extraction module
  • N is an integer greater than or equal to 2 and N;
  • a classification module configured to classify the target features to obtain a behavior recognition result.
  • an embodiment of the present application further provides a behavior recognition device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • a behavior recognition method based on feature fusion is implemented, wherein the behavior recognition method based on feature fusion includes: extracting frames from an input video to obtain a frame image; obtaining color information and optical flow information of the frame image for each frame image, and fusing the color information and the optical flow information of each pixel of the frame image to obtain a fusion image; input the fusion image to the feature extraction network Perform feature extraction to obtain the target feature, wherein the feature extraction network includes a first branch, a second branch and a fusion module, the first branch is used to extract the first feature representing the time dimension information of the input video, the second branch is used to extract The second feature representing the spatial dimension information of the input video, the fusion module is used to fuse the first feature and the second feature to obtain the target feature, the first branch includes N first feature extraction modules,
  • the embodiment of the present application further provides a storage medium, wherein a computer program is stored, and the computer program is used to execute a behavior recognition method based on feature fusion, wherein the behavior recognition method based on feature fusion includes: performing frame extraction on an input video to obtain a frame image; for each of the frame images, acquiring color information and optical flow information of the frame image, and fusing the color information and optical flow information of each pixel of the frame image to obtain a fusion image; inputting the fusion image to a feature extraction network for feature extraction to obtain target features, wherein the feature extraction network includes a first branch, A second branch and a fusion module, the first branch is used to extract the first feature representing the temporal dimension information of the input video, the second branch is used to extract the second feature representing the spatial dimension information of the input video, the fusion module is used to fuse the first feature and the second feature to obtain the target feature, the first branch includes N first feature extraction modules, the second branch includes N second feature extraction modules, the input of the nth first
  • the behavior recognition method, device, equipment, and storage medium based on feature fusion proposed in this application enable the model to pay more attention to the information of the region of interest, which is conducive to improving the accuracy of behavior recognition and improving the training efficiency of the model.
  • Fig. 1 is the flow chart of the behavior recognition method based on feature fusion of the embodiment of the present application
  • Fig. 2 is the flow chart of the step that fuses the color information of each pixel of the frame image and the optical flow information to obtain the fusion image;
  • Fig. 3 is the flowchart of step S300;
  • Fig. 4 is a schematic diagram of the principle of the feature extraction network
  • Fig. 5 is a schematic diagram of the principle of the first feature extraction module
  • Fig. 6 is a schematic diagram of the principle of the first attention mechanism module
  • Fig. 7 is a schematic diagram of the principle of the second special extraction module
  • Fig. 8 is a schematic diagram of the principle of the second attention mechanism module
  • FIG. 9 is a structural diagram of a behavior recognition device according to an embodiment of the present application.
  • the embodiment of the present application provides a behavior recognition method, device, device, and storage medium based on feature fusion; extract frames from an input video to obtain a frame image; for each frame image, obtain color information and optical flow information of the frame image, and fuse the color information and optical flow information of each pixel of the frame image to obtain a fusion image; input the fusion image to a feature extraction network for feature extraction to obtain target features, wherein the feature extraction network includes a first branch, a second branch, and a fusion module.
  • the second feature of the fusion module is used to fuse the first feature and the second feature to obtain the target feature.
  • the first branch includes N first feature extraction modules
  • the second branch includes N second feature extraction modules.
  • the input of the nth first feature extraction module is the output of the n-1th first feature extraction module
  • the input of the nth second feature extraction module is the fusion result of the output of the n-1th first feature extraction module and the output of the n-1th second feature extraction module.
  • the color information and optical flow information are fused, and the color information is guided by the optical flow information, which is beneficial to the feature extraction of the fused image;
  • the fusion result of the output of the n-1 first feature extraction module and the output of the n-1 second feature extraction module is used as the input of the n-th second feature extraction module, and the temporal dimension information and spatial dimension information are fused to capture the semantic information and motion information in the video, and the attention mechanism is introduced in the feature extraction model, so that the model can pay more attention to the information of the region of interest, which is conducive to improving the accuracy of behavior recognition. rate and improve the training efficiency of the model.
  • the semantic information includes static information such as the shape, color, expression, and brightness of the character, and the motion information includes dynamic information such as clapping, waving, shaking, walking, or jumping.
  • AI artificial intelligence
  • a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • artificial intelligence is a comprehensive technique of computer science that attempts to understand the nature of intelligence and produce a new kind of intelligent machine that can respond in a similar way to human intelligence.
  • Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
  • Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics.
  • Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning. With the research and progress of artificial intelligence technology, artificial intelligence has been researched and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, robots, smart medical care, etc. It is believed that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important value.
  • FIG. 1 is a flowchart of a behavior recognition method based on feature fusion.
  • the behavior recognition method includes but is not limited to the following steps:
  • Step S100 extracting frames from the input video to obtain a frame image
  • Step S200 for each frame image, acquire the color information and optical flow information of the frame image, and fuse the color information and optical flow information of each pixel of the frame image to obtain a fused image;
  • Step S300 input the fused image to the feature extraction network for feature extraction to obtain target features
  • the feature extraction network includes a first branch, a second branch and a fusion module
  • the first branch is used to extract the first feature representing the time dimension information of the input video
  • the second branch is used to extract the second feature representing the spatial dimension information of the input video
  • the fusion module is used to fuse the first feature and the second feature to obtain the target feature
  • the first branch includes N first feature extraction modules based on the attention mechanism
  • the second branch includes N second feature extraction modules based on the attention mechanism
  • the input of the nth first feature extraction module is n-1
  • the output of the first feature extraction module, the input of the nth second feature extraction module is the fusion result of the output of the n-1th first feature extraction module and the output of the n-1th second feature extraction module
  • N is an integer greater than or equal to 2
  • n is an integer between 2 and N;
  • Step S400 classifying the target features to obtain a behavior recognition result.
  • the color information and the optical flow information are fused, and the color information is guided by the optical flow information, which is beneficial to the feature extraction of the fused image;
  • the fusion result of the output of the n-1 first feature extraction module and the output of the n-1 second feature extraction module is used as the input of the n-th second feature extraction module, and the temporal dimension information and spatial dimension information are fused to capture semantic information and motion information in the video, and an attention mechanism is introduced in the feature extraction model, so that the model can pay more attention to the information of the region of interest, which is conducive to improving The accuracy of behavior recognition and improve the training efficiency of the model.
  • the video is a series of captured frame images displayed at a given frequency.
  • a single frame image can be obtained by stopping at a specific frame in a sequence.
  • image distortion should be avoided in the process of decompression, decoding and frame extraction, which is conducive to improving the accuracy of behavior recognition.
  • the format of the input video may include other video formats such as MP4, RMVB, MKV, and AVI.
  • RGB color is often said optical three primary colors, R stands for Red (red), G stands for Green (green), B stands for Blue (blue). Any color that can be seen by the naked eye in nature can be formed by mixing and superimposing these three colors.
  • the mode of describing image color through RGB information is an additive color method mode, and any color can be described through the radiation amount of R, G, and B.
  • the value range of the three components of R, G, and B is 0-255, 0 means no stimulation amount, and 255 means the stimulation amount reaches the maximum value.
  • the optical flow information expresses the change of the image, contains the information of the target's movement, and can be used to determine the movement of the target.
  • the color information and optical flow information of each pixel of the frame image are fused to obtain a fused image, specifically including:
  • Step S210 for each pixel of the frame image, obtain the first element value of each color channel according to the color information
  • Step S220 for each pixel of the frame image, in each color channel, the optical flow information of the pixel is multiplied and fused with the first element value of the pixel to obtain the second element value of the pixel, and the second element value is standardized to obtain the target element value;
  • Step S230 combining target element values of all color channels of the pixel to obtain a fused image.
  • the color information is RBG color
  • the color information includes three color channels of R channel, B channel and G channel.
  • the first element value input i,j of each color channel is obtained by extracting the color information.
  • the optical flow information is expressed as optical i,j .
  • the optical flow information of the pixel is used as the weight of the first element value of the pixel, and the two are fused to obtain the second element value of the pixel.
  • the color information is guided by the optical flow information, which is beneficial to the feature representation of the fusion image.
  • standardizing the second element value to obtain the target element value includes: calculating the mean value of the second element value; calculating the variance of the second element value; dividing the difference between the second element value and the mean value by the variance to obtain the target element value. Normalizes and normalizes the element values of an image.
  • step S230 for a frame image, combine target element values of all color channels of a pixel, the element values of the pixel; obtain a fused image according to the element values of all pixels.
  • FIG. 4 is a schematic diagram of the principle of the feature extraction network.
  • the feature extraction network includes a first branch, a second branch and a fusion module.
  • the fusion image is input to the feature extraction network for feature extraction to obtain target features, including:
  • Step S310 performing downsampling processing on the fused image to obtain a second fused image, and inputting the second fused image to the first branch to obtain the first feature;
  • Step S320 input the fused image to the second branch to obtain the second feature
  • Step S330 combining the first feature and the second feature through the fusion module to obtain the target feature.
  • the size of the fused image is B*C*T*H*W, where B is batch_size, that is, the number of samples selected for one training; C is the number of channels; T is the time series; H and W are the length and width of the fused image respectively.
  • the fused image is subjected to downsampling rate processing to obtain a second fused image, and the size of the second fused image is B*C/4*T*H*W.
  • the first branch can capture the change information extracted on the time dimension of the input video.
  • the first branch includes N first feature extraction modules connected in sequence.
  • N is 2; of course, in other embodiments, N can be other integers greater than or equal to 2, such as 3 and so on.
  • the second fused image is sequentially subjected to feature extraction by two first feature extraction modules to obtain the first feature.
  • the second fused image is input to the first first feature extraction module, and the first first feature extraction module outputs a first output feature;
  • the first output feature output by the first first feature extraction module is input to the second first feature extraction module, the second first feature extraction module outputs another first output feature, and the first output feature output by the second first feature extraction module is used as the first feature.
  • FIG. 5 is a schematic diagram of the principle of the first feature extraction module.
  • the structure of each first feature extraction module is as follows:
  • the first first convolutional layer includes: 1x1x1 size convolutional layer and batch normalization layer;
  • the second first convolutional layer includes: a 3x3x3 size convolutional layer and a batch normalization layer;
  • the third first convolutional layer includes: 1x1x1 size convolutional layer and batch normalization layer;
  • the first attention mechanism module
  • a fusion operation is used to fuse the first attention feature and the first input feature to obtain the first output feature.
  • the process of feature extraction through the first feature extraction module is as follows: the first input feature is sequentially subjected to three first convolution layers for convolution operation to obtain the first convolution result; the first convolution result is subjected to feature extraction by the first attention mechanism module to obtain the first attention feature; the first attention feature and the first input feature are concatenated to obtain the first output feature.
  • FIG. 6 is a schematic diagram of the principle of the first attention mechanism module.
  • the structure of the first attention mechanism module is as follows: the first full pooling layer, two first fully connected layers, the first activation function layer and a fusion operation, which is used to concatenate the first sub-attention feature and the first convolution result to obtain the first attention feature.
  • the first activation function layer is a sigmoid activation function layer.
  • the process of extracting the first convolution result through the first attention mechanism module to obtain the first attention feature is as follows: the first convolution result is passed through the first full pooling layer, at least one first fully connected layer and the first activation function layer to obtain the first sub-attention feature, and the first sub-attention feature is fused with the first convolution result to obtain the first attention feature.
  • step S320 input the fused image to the second branch to obtain the second feature, wherein the size of the fused image is B*C*T*H*W, which remains unchanged, so that the second branch can capture and extract the change information on the spatial dimension of the input video.
  • the second branch includes N second feature extraction modules connected in sequence.
  • N is 2; of course, in other embodiments, N can be other integers greater than or equal to 2, such as 3 and so on. It should be noted that the number of the second feature extraction modules is the same as the number of the first feature extraction modules.
  • the fused image is sequentially subjected to feature extraction by two second feature extraction modules to obtain a second feature.
  • the fusion image is input into the first second feature extraction module, and the first second feature extraction module outputs a second output feature; the second output feature output by the first second feature extraction module is fused with the first output feature output by the first first feature extraction module, and then input to the second first feature extraction module, the second second feature extraction module outputs another first output feature, and the second output feature output by the second second feature extraction module is used as the second feature.
  • the fusion method of the second output feature output by the second feature extraction module and the first output feature output by the first feature extraction module adopts horizontal connection.
  • FIG. 7 is a schematic diagram of the principle of the second feature extraction module.
  • the structure of each second feature extraction module is as follows:
  • the first and second convolutional layers include: 1x1x1 size convolutional layer and batch normalization layer;
  • the second second convolutional layer includes: a 3x3x3 size convolutional layer and a batch normalization layer;
  • the third second convolutional layer includes: 1x1x1 size convolutional layer and batch normalization layer;
  • the second attention mechanism module
  • a fusion operation is used to fuse the second attention feature and the second input feature to obtain the second output feature.
  • the process of feature extraction through the second feature extraction module is as follows: the second input feature is subjected to three second convolution layers for convolution operation to obtain the second convolution result, the second input feature is the feature input to the second feature extraction module; the second convolution result is extracted through the second attention mechanism module to obtain the second attention feature; the second attention feature and the second input feature are fused to obtain the second output feature, and the second output feature is the output feature of the second feature extraction module.
  • FIG. 8 is a schematic diagram of the principle of the first attention mechanism module.
  • the structure of the second attention mechanism module is as follows: a second full pooling layer, two second fully connected layers, a second activation function layer and a fusion operation, which is used to concatenate the first sub-attention feature and the first convolution result to obtain the first attention feature.
  • the second activation function layer is a sigmoid activation function layer.
  • the process of making the second convolution result undergo feature extraction through the second attention mechanism module to obtain the second attention feature is as follows: the second convolution result is passed through the second full pooling layer, two second fully connected layers and the second activation function layer to obtain the second sub-attention feature, and the second sub-attention feature and the second convolution result are fused to obtain the second attention feature.
  • the first feature and the second feature are spliced through the fusion module to obtain the target feature.
  • the target feature combines the time dimension information of the first feature and the space dimension information of the second feature, and includes semantic information and motion information of the input video.
  • the target feature is classified by a classifier to obtain a behavior recognition result.
  • a classifier to obtain a behavior recognition result.
  • the sofamax function is used as the classifier.
  • other classifiers such as SVM vector machines, may also be used.
  • FIG. 9 is a structural diagram of a behavior recognition device.
  • An embodiment of the present application also provides a behavior recognition device, which applies the above behavior recognition method.
  • the behavior recognition device includes a frame extraction module 10 , a fusion image acquisition module 20 , a feature extraction module 30 and a classification module 40 .
  • the frame extraction module 10 is used to extract frames of the input video to obtain frame images.
  • the fused image acquisition module 20 is used to acquire color information and optical flow information of each frame image, and fuse the color information and optical flow information of each pixel of the frame image to obtain a fused image.
  • the feature extraction module 30 is used to input the fused image to the feature extraction network for feature extraction to obtain target features.
  • the feature extraction network is as above, that is, the feature extraction network includes a first branch, a second branch and a fusion module, the first branch is used to extract the first feature representing the time dimension information of the input video, the second branch is used to extract the second feature representing the spatial dimension information of the input video, the fusion module is used to fuse the first feature and the second feature to obtain the target feature, the first branch includes N first feature extraction modules, the second branch includes N second feature extraction modules, the input of the n first feature extraction module is the output of the n-1 first feature extraction module, and the input of the n second feature extraction module is the n-1 first feature extraction module The fusion result of the output of the feature extraction module and the output of the n-1th second feature extraction module, N is an integer greater than or equal to 2, and n is an integer between 2 and N.
  • the classification module 40 is used to classify target features to obtain behavior recognition results.
  • each module of the behavior recognition device corresponds to each step of the above-mentioned behavior recognition method, and the behavior recognition device and the behavior recognition method both have the same technical solution, solve the same technical problem, and have the same beneficial effect.
  • the behavior recognition device it fuses the color information and optical flow information to the frame image of the input video, and guides the color information through the optical flow information, which is beneficial to the feature extraction of the fused image; the fusion result of the output of the n-1 first feature extraction module and the output of the n-1 second feature extraction module is used as the input of the n-th second feature extraction module, and the temporal dimension information and spatial dimension information are fused to capture the semantic information and motion information in the video, and the attention mechanism is introduced in the feature extraction model, so that the model can pay more attention to the information of the region of interest, which is conducive to improving The accuracy of behavior recognition and improve the training efficiency of the model.
  • An embodiment of the present application also provides a behavior recognition device, the behavior recognition device: a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the behavior recognition method based on feature fusion is realized when the processor executes the computer program.
  • the behavior recognition method based on feature fusion includes: extracting frames from an input video to obtain a frame image; for each frame image, obtaining color information and optical flow information of the frame image, and fusing the color information and the optical flow information of each pixel of the frame image to obtain a fused image; inputting the fused image to a feature extraction network for feature extraction to obtain target features, wherein the feature extraction network includes a first branch, a second branch, and a fusion module, the first branch is used to extract the first feature representing the time dimension information of the input video, and the second branch is used to extract space representing the input video
  • the second feature of dimension information, the fusion module is used to fuse the first feature and the second feature to obtain the target feature
  • the first branch includes N first feature extraction modules
  • the second branch includes N second feature extraction modules
  • the input of the nth first feature extraction module is the output of the n-1th first feature extraction module
  • the input of the nth second feature extraction module is the fusion result of the output of the n-1th first
  • the processor and memory can be connected by a bus or other means.
  • the memory can be used to store software programs as well as computer-executable programs.
  • the memory may include high-speed random access memory, and may also include memory, such as at least one magnetic disk storage device, flash memory device, or other solid-state storage device.
  • the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the software programs and instructions required to implement the communication method of the above-mentioned embodiment are stored in the memory, and when executed by the processor, the behavior recognition method in the above-mentioned embodiment is executed, for example, the steps S100 to S400, S210 to S230, and S310 to S330 described above are executed.
  • node embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • an embodiment of the present application also provides a storage medium, the storage medium stores a computer program, and the computer program is executed by a processor or a controller, for example, executed by a processor, so that the above-mentioned processor can execute the behavior recognition method in the above-mentioned embodiment, for example, execute the steps S100 to S400, S210 to S230, and S310 to S330 described above.
  • Computer readable storage media can be either nonvolatile or volatile.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and that can be accessed by a computer.
  • communication media typically embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is known to those of ordinary skill in the art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本申请涉及人工智能领域,提供了基于特征融合的行为识别方法、装置、设备及存储介质,其中方法包括对输入视频进行抽帧;融合颜色信息和光流信息得到融合图像;将融合图像输入至特征提取网络得到目标特征;对目标特征进行分类得到行为识别结果;通过光流信息对颜色信息进行指导有利于对融合图像的特征提取;将前一第一特征提取模块的输出与前一第二特征提取模块的输出的融合结果作为后一第二特征提取模块的输入,将时间维度信息和空间维度信息融合,捕捉视频中的语义信息和运动信息,并在特征提取模型中引入注意力机制,使模型能更关注感兴趣区域的信息,有利于提高行为识别的准确率和提高模型的训练效率。

Description

基于特征融合的行为识别方法、装置、设备及存储介质
本申请要求于2022年01月18日提交中国专利局、申请号为202210055992.2,发明名称为“基于特征融合的行为识别方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,提供基于特征融合的行为识别方法、装置、设备及存储介质。
背景技术
行为识别是计算机视觉识别领域的一个课题。视频可以被分解为空间维度信息和时间维度信息两部分。空间维度信息以单幅图像的的形式表现出来,其携带着目标的形状、颜色等静态信息。而时间维度信息则通过多帧连续图像表现出来,反应了目标体的移动信息。通过两个神经网络对图像的空间维度信息和时间维度信息分开处理再融合,能实现目标物的静态信息和动态信息的结合。
技术问题
以下是发明人意识到的现有技术的技术问题:通过两个神经网络对图像的空间维度信息和时间维度信息分开处理再融合,能实现目标物的静态信息和动态信息的结合的方式,存在着如模型难以训练、算法太复杂、特征提取不准确导致行为识别的准确率和模型的训练效率较低等问题。
技术解决方案
第一方面,本申请实施例提供了基于特征融合的行为识别方法,包括:
对输入视频进行抽帧,得到帧图像;
对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
对所述目标特征进行分类,得到行为识别结果。
第二方面,本申请实施例还提供了基于特征融合的行为识别装置,包括:
抽帧模块,用于对输入视频进行抽帧,得到帧图像;
融合图像获取模块,用于对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
特征提取模块,用于将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所 述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
分类模块,用于对所述目标特征进行分类,得到行为识别结果。
第三方面,本申请实施例还提供了行为识别设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现基于特征融合的行为识别方法,其中,所述基于特征融合的行为识别方法包括:对输入视频进行抽帧,得到帧图像;对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;对所述目标特征进行分类,得到行为识别结果。
第四方面,本申请实施例还提供了存储介质,其中,存储有计算机程序,所述计算机程序用于执行基于特征融合的行为识别方法,其中,所述基于特征融合的行为识别方法包括:对输入视频进行抽帧,得到帧图像;对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;对所述目标特征进行分类,得到行为识别结果。
有益效果
本申请提出的基于特征融合的行为识别方法、装置、设备及存储介质,使模型能更关注感兴趣区域的信息,有利于提高行为识别的准确率和提高模型的训练效率。
附图说明
图1是本申请实施例基于特征融合的行为识别方法的流程图;
图2是对帧图像的每个像素的颜色信息和光流信息进行融合得到融合图像的步骤的流程图;
图3是步骤S300的流程图;
图4是特征提取网络的原理示意图;
图5是第一特征提取模块的原理示意图;
图6是第一注意力机制模块的原理示意图;
图7是第二特这个提取模块的原理示意图;
图8是第二注意力机制模块的原理示意图;
图9是本申请实施例行为识别装置的结构图。
本发明的实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。在本申请的描述中,若干的含义是一个或者多个,多个的含义是两个以上,大于、小于、超过等理解为不包括本数,以上、以下、以内等理解为包括本数。
本申请实施例提供了基于特征融合的行为识别方法、装置、设备及存储介质;对输入视频进行抽帧,得到帧图像;对每个帧图像,获取帧图像的颜色信息和光流信息,对帧图像的每个像素的颜色信息和光流信息进行融合得到融合图像;将融合图像输入至特征提取网络进行特征提取得到目标特征,其中特征提取网络包括第一分支、第二分支和融合模块,第一分支用于提取表示输入视频的时间维度信息的第一特征,第二分支用于提取表示输入视频的空间维度信息的第二特征,融合模块用于融合第一特征和第二特征得到目标特征,第一分支包括N个第一特征提取模块,第二分支包括N个第二特征提取模块,第n个第一特征提取模块的输入为第n-1个第一特征提取模块的输出,第n个第二特征提取模块的输入为第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;对目标特征进行分类,得到行为识别结果;对输入视频的帧图像,融合颜色信息和光流信息,通过光流信息对颜色信息进行指导,有利于对融合图像的特征提取;将第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果作为第n个第二特征提取模块的输入,将时间维度信息和空间维度信息融合,捕捉视频中的语义信息和运动信息,并在特征提取模型中引入注意力机制,使模型能更关注感兴趣区域的信息,有利于提高行为识别的准确率和提高模型的训练效率。
其中语义信息包括人物的形状、颜色、表情、亮度等静态信息,运动信息包括拍手、挥手、摇晃、行走或跳跃等动态信息。
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个综合技术,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。
人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。随着人工智能技术研究和进步,人工智能在多个领域展开研究和应用,例如常见的智能家居、智能客服、虚拟助理、智能音箱、智能营销、无人驾驶、自动驾驶、机器人、智能医疗等,相信随着技术的发展,人工智能将在更多的领域得到应用,并发挥越来越重要的价值。
下面结合附图,对本申请实施例作进一步阐述。
参照图1,图1是基于特征融合的行为识别方法的流程图。
如图1所示,行为识别方法包括但不限于有以下步骤:
步骤S100、对输入视频进行抽帧,得到帧图像;
步骤S200、对每个帧图像,获取帧图像的颜色信息和光流信息,对帧图像的每个像素的颜色信息和光流信息进行融合得到融合图像;
步骤S300、将融合图像输入至特征提取网络进行特征提取得到目标特征,其中特征提取网络包括第一分支、第二分支和融合模块,第一分支用于提取表示输入视频的时间维度信息的第一特征,第二分支用于提取表示输入视频的空间维度信息的第二特征,融合模块用于融合第一特征和第二特征得到目标特征,第一分支包括N个基于注意力机制的第一特征提取模块,第二分支包括N个基于注意力机制的第二特征提取模块,第n个第一特征提取模块的输入为第n-1个第一特征提取模块的输出,第n个第二特征提取模块的输入为第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
步骤S400、对目标特征进行分类,得到行为识别结果。
在该实施例中,对输入视频的帧图像,融合颜色信息和光流信息,通过光流信息对颜色信息进行指导,有利于对融合图像的特征提取;将第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果作为第n个第二特征提取模块的输入,将时间维度信息和空间维度信息融合,捕捉视频中的语义信息和运动信息,并在特征提取模型中引入注意力机制,使模型能更关注感兴趣区域的信息,有利于提高行为识别的准确率和提高模型的训练效率。
对于步骤S100,视频是一系列捕获的帧图像以给定的频率显示的。而对视频抽帧,即为通过在一序列的特定帧处停止可获得单个的帧图像。
对输入视频进行解压缩和解码,对解码后的数据抽帧提取出与输入视频对应的多个帧图像。
另外,在解压缩、解码和抽帧过程中应避免图像失真,这有利于提高行为识别的准确率。
具体地,输入视频的格式可以包括MP4、RMVB、MKV、AVI等其他视频格式。
对于步骤S200,由输入视频得到了多个帧图像,需要对所有帧图像进行处理。对每个帧图像,获取帧图像的所有像素的颜色信息,颜色信息具体为RGB信息。RGB色彩就是常说的光学三原色,R代表Red(红色),G代表Green(绿色),B代表Blue(蓝色)。自然界中肉眼所能看到的任何色彩都可以由这三种色彩混合叠加而成。通过RGB信息描述图像色彩的模式是一种加色法模式,通过R、G、B的辐射量,可描述出任一颜色。计算机定义颜色时R、G、B三种成分的取值范围是0-255,0表示没有刺激量,255表示刺激量达最大值。
当物体在运动时,物体在图像上对应点的亮度模式也在运动,这种图像亮度模式的表观运动就是光流。光流信息表达了图像的变化,包含了目标运动的信息,能用来确定目标的运动情况。
参照图2,对帧图像的每个像素的颜色信息和光流信息进行融合得到融合图像,具体包括:
步骤S210、对帧图像的每个像素,根据颜色信息得到每个颜色通道的第一元素值;
步骤S220、对帧图像的每个像素,在每个颜色通道中,将像素的光流信息与像素的第一元素值作相乘融合得到像素的第二元素值,对第二元素值作标准化处理得到目标元素值;
步骤S230、将像素的所有颜色通道的目标元素值组合得到融合图像。
对于步骤S210,其中,由于颜色信息为RBG颜色,因此颜色信息包括R通道、B通道和G通道这三个颜色通道。对帧图像的像素(i,j),由颜色信息提取得到每个颜色通道的第一元素值input i,j
对于步骤S220,对帧图像的像素(i,j),光流信息表示为optical i,j。以像素的光流信息作为像素的第一元素值的权重,使两者融合得到像素的第二元素值。通过式子可以表示为:Input i,j=input i,j*optical i,j,其中Input i,j为第二元素值。通过光流信息对颜色信息进行指 导,有利于融合图像的特征表示。
其中,对第二元素值作标准化处理得到目标元素值,包括:计算第二元素值的均值;计算第二元素值的方差;将第二元素值与均值之差除以方差,得到目标元素值。使图像的元素值归一化和标准化。
对于步骤S230,对于一个帧图像,将像素的所有颜色通道的目标元素值组合,该像素的元素值;根据所有像素的元素值得到融合图像。
参照图4,图4是特征提取网络的原理示意图。特征提取网络包括第一分支、第二分支和融合模块。
参照图3,对于步骤S300,将融合图像输入至特征提取网络进行特征提取得到目标特征,包括:
步骤S310、将融合图像进行降采样率处理得到第二融合图像,将第二融合图像输入至第一分支得到第一特征;
步骤S320、将融合图像输入至第二分支得到第二特征;
步骤S330、通过融合模块将第一特征和第二特征拼接,得到目标特征。
对于步骤S310,融合图像的大小为B*C*T*H*W,其中B为batch_size,即一次训练所选取的样本数;C为通道数;T为时间序列;H和W分别为融合图像的长和宽。将融合图像进行降采样率处理得到第二融合图像,第二融合图像的大小为B*C/4*T*H*W。通过降低采样率,使得第一分支可以捕捉提取到输入视频时间维度上的变化信息。
对于第一分支,第一分支包括依次连接的N个第一特征提取模块。在该实施例中,N为2;当然在其他实施例中,N可以为其他大于或等于2的整数,例如3等。
使第二融合图像依次经过两个第一特征提取模块进行特征提取得到第一特征。具体地,将第二融合图像输入第一个第一特征提取模块,第一个第一特征提取模块输出一个第一输出特征;将第一个第一特征提取模块输出的第一输出特征输入至第二个第一特征提取模块,第二个第一特征提取模块输出另一个第一输出特征,将第二个第一特征提取模块输出的第一输出特征作为第一特征。
另外,参照图5,图5是第一特征提取模块的原理示意图。每个第一特征提取模块的结构如下:
第1个第一卷积层包括:1x1x1大小的卷积层和批量归一化层;
第2个第一卷积层包括:3x3x3大小的卷积层和批量归一化层;
第3个第一卷积层包括:1x1x1大小的卷积层和批量归一化层;
第一注意力机制模块;
融合运算,该融合运算用于将第一注意力特征和第一输入特征融合得到第一输出特征。
则经过第一特征提取模块进行特征提取的过程如下:使第一输入特征依次经过三个第一卷积层进行卷积运算得到第一卷积结果;使第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征;将第一注意力特征和第一输入特征拼接得到第一输出特征。
其中,参照图6,图6是第一注意力机制模块的原理示意图。第一注意力机制模块的结构如下:第一全池化层,两个第一全连接层、第一激活函数层和融合运算,该融合运算用于将第一子注意力特征和第一卷积结果拼接得到第一注意力特征。
具体地,第一激活函数层为sigmoid激活函数层。
则使第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征的过程如下:使第一卷积结果经过第一全池化层、至少一个第一全连接层和第一激活函数层得到第一子注意力特征,将第一子注意力特征和第一卷积结果融合得到第一注意力特征。
对于步骤S320,将融合图像输入至第二分支得到第二特征,其中融合图像的大小为B*C*T*H*W,保持不变,便于第二分支可以捕捉提取到输入视频空间维度上的变化信息。
对于第二分支,第二分支包括依次连接的N个第二特征提取模块。在该实施例中,N为2;当然在其他实施例中,N可以为其他大于或等于2的整数,例如3等。需要说明的是,第 二特征提取模块的数量与第一特征提取模块的数量相同。
使融合图像依次经过两个第二特征提取模块进行特征提取得到第二特征。具体地,将融合图像输入第一个第二特征提取模块,第一个第二特征提取模块输出一个第二输出特征;将第一个第二特征提取模块输出的第二输出特征和第一个第一特征提取模块输出的第一输出特征融合,然后输入至第二个第一特征提取模块,第二个第二特征提取模块输出另一个第一输出特征,将第二个第二特征提取模块输出的第二输出特征作为第二特征。
需要说明的是,第二特征提取模块输出的第二输出特征和第一特征提取模块输出的第一输出特征的融合方式采用横向连接。
另外,参照图7,图7是第二特征提取模块的原理示意图。每个第二特征提取模块的结构如下:
第1个第二卷积层包括:1x1x1大小的卷积层和批量归一化层;
第2个第二卷积层包括:3x3x3大小的卷积层和批量归一化层;
第3个第二卷积层包括:1x1x1大小的卷积层和批量归一化层;
第二注意力机制模块;
融合运算,该融合运算用于将第二注意力特征和第二输入特征融合得到第二输出特征。
则经过第二特征提取模块进行特征提取的过程如下:使第二输入特征经过三个第二卷积层进行卷积运算得到第二卷积结果,第二输入特征为输入至第二特征提取模块的特征;使第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征;将第二注意力特征和第二输入特征融合得到第二输出特征,第二输出特征为第二特征提取模块输出的特征。
其中,参照图8,图8是第一注意力机制模块的原理示意图。第二注意力机制模块的结构如下:第二全池化层,两个第二全连接层、第二激活函数层和融合运算,该融合运算用于将第一子注意力特征和第一卷积结果拼接得到第一注意力特征。
具体地,第二激活函数层为sigmoid激活函数层。
则使第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征的过程如下:使第二卷积结果经过第二全池化层、两个第二全连接层和第二激活函数层得到第二子注意力特征,将第二子注意力特征和第二卷积结果融合得到第二意力特征。
对于步骤S330,通过融合模块将第一特征和第二特征拼接,得到目标特征,目标特征融合了第一特征的时间维度信息和第二特征的空间维度信息,包含了输入视频的语义信息和运动信息。
对于步骤S400,通过分类器对目标特征进行分类,得到行为识别结果。具体地,在该实施例中,采用sofamax函数作为分类器。当然在其他实施例中,也可以采用其他分类器,例如SVM向量机。
参照图9,图9是行为识别装置的结构图。本申请的一个实施例还提供了行为识别装置,应用如上的行为识别方法。
如图9所示,行为识别装置包括抽帧模块10、融合图像获取模块20、特征提取模块30和分类模块40。
其中,抽帧模块10用于对输入视频进行抽帧,得到帧图像。
融合图像20获取模块用于对每个帧图像,获取帧图像的颜色信息和光流信息,对帧图像的每个像素的颜色信息和光流信息进行融合得到融合图像。
特征提取模块30用于将融合图像输入至特征提取网络进行特征提取得到目标特征。其中特征提取网络如上,即特征提取网络包括第一分支、第二分支和融合模块,第一分支用于提取表示输入视频的时间维度信息的第一特征,第二分支用于提取表示输入视频的空间维度信息的第二特征,融合模块用于融合第一特征和第二特征得到目标特征,第一分支包括N个第一特征提取模块,第二分支包括N个第二特征提取模块,第n个第一特征提取模块的输入为第n-1个第一特征提取模块的输出,第n个第二特征提取模块的输入为第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果,N为大于或等于2的整 数,n为2至N之间的整数。
分类模块40用于对目标特征进行分类,得到行为识别结果。
需要说明的是,该行为识别装置的各模块与上述行为识别方法的各步骤一一对应,行为识别装置与行为识别方法两者具有相同的技术方案,解决了相同的技术问题,具有相同的有益效果。
对于行为识别装置,其对输入视频的帧图像,融合颜色信息和光流信息,通过光流信息对颜色信息进行指导,有利于对融合图像的特征提取;将第n-1个第一特征提取模块的输出与第n-1个第二特征提取模块的输出两者的融合结果作为第n个第二特征提取模块的输入,将时间维度信息和空间维度信息融合,捕捉视频中的语义信息和运动信息,并在特征提取模型中引入注意力机制,使模型能更关注感兴趣区域的信息,有利于提高行为识别的准确率和提高模型的训练效率。
本申请的一个实施例还提供了行为识别设备,该行为识别设备:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序。处理器执行计算机程序时实现基于特征融合的行为识别方法。其中,所述基于特征融合的行为识别方法包括:对输入视频进行抽帧,得到帧图像;对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;对所述目标特征进行分类,得到行为识别结果。
处理器和存储器可以通过总线或者其他方式连接。
存储器作为一种计算机可读存储介质,可用于存储软件程序以及计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括存储器,例如至少一个磁盘存储器件、闪存器件、或其他固态存储器件。在一些实施方式中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
实现上述实施例的通信方法所需的软件程序以及指令存储在存储器中,当被处理器执行时,执行上述实施例中的行为识别方法,例如,执行以上描述的步骤S100至步骤S400、步骤S210至步骤S230和步骤S310至步骤S330。
以上所描述的节点实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
此外,本申请的一个实施例还提供了一种存储介质,该存储介质存储有计算机程序,该计算机程序被一个处理器或控制器执行,例如,被一个处理器执行,可使得上述处理器执行上述实施例中的行为识别方法,例如,执行以上描述的步骤S100至步骤S400、步骤S210至步骤S230和步骤S310至步骤S330。计算机可读存储介质可以是非易失性,也可以是易失性。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结 构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
以上是对本申请的较佳实施进行了具体说明,但本申请并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请精神的前提下还可作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。

Claims (20)

  1. 基于特征融合的行为识别方法,其中,包括:
    对输入视频进行抽帧,得到帧图像;
    对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
    将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个基于注意力机制的第一特征提取模块,所述第二分支包括N个基于注意力机制的第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
    对所述目标特征进行分类,得到行为识别结果。
  2. 根据权利要求1所述的行为识别方法,其中,所述对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像,包括:
    对所述帧图像的每个像素,根据所述颜色信息得到每个颜色通道的第一元素值;
    对所述帧图像的每个像素,在每个所述颜色通道中,将所述像素的光流信息与所述像素的第一元素值作相乘融合得到所述像素的第二元素值,对所述第二元素值作标准化处理得到目标元素值;
    将所述像素的所有所述颜色通道的所述目标元素值组合得到所述融合图像。
  3. 根据权利要求2所述的行为识别方法,其中,所述对所述第二元素值作标准化处理得到目标元素值,包括:
    计算所述第二元素值的均值;
    计算所述第二元素值的方差;
    将所述第二元素值与所述均值之差除以所述方差,得到所述目标元素值。
  4. 根据权利要求1所述的行为识别方法,其中,所述将所述融合图像输入至特征提取网络进行特征提取得到目标特征,包括:
    将所述融合图像进行降采样率处理得到第二融合图像,将所述第二融合图像输入至所述第一分支得到所述第一特征;
    将所述融合图像输入至所述第二分支得到所述第二特征;
    通过所述融合模块将所述第一特征和所述第二特征拼接,得到所述目标特征。
  5. 根据权利要求4所述的行为识别方法,其中,所述将所述第二融合图像输入至所述第一分支得到所述第一特征,包括:
    使所述第二融合图像依次经过N个所述第一特征提取模块进行特征提取得到所述第一特征;
    其中,经过所述第一特征提取模块进行特征提取,包括:
    使第一输入特征经过至少一个第一卷积层进行卷积运算得到第一卷积结果,所述第一输入特征为输入至所述第一特征提取模块的特征;
    使所述第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征;
    将所述第一注意力特征和所述第一输入特征融合得到第一输出特征,所述第一输出特征为所述第一特征提取模块输出的特征。
  6. 根据权利要求5所述的行为识别方法,其中,将所述融合图像输入至所述第二分支得到所述第二特征,包括:
    使所述融合图像依次经过N个所述第二特征提取模块进行特征提取得到所述第二特征;
    其中,经过所述第二特征提取模块进行特征提取,包括:
    使第二输入特征经过至少一个第二卷积层进行卷积运算得到第二卷积结果,所述第二输入特征为输入至所述第二特征提取模块的特征;
    使所述第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征;
    将所述第二注意力特征和所述第二输入特征融合得到第二输出特征,所述第二输出特征为所述第二特征提取模块输出的特征。
  7. 根据权利要求6所述的行为识别方法,其中,所述使所述第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征,包括:
    使所述第一卷积结果经过第一全池化层、至少一个第一全连接层和第一激活函数层得到第一子注意力特征,将所述第一子注意力特征和所述第一卷积结果融合得到所述第一注意力特征;
    所述使所述第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征,包括:
    使所述第二卷积结果经过第二全池化层、至少一个第二全连接层和第二激活函数层得到第二子注意力特征,将所述第二子注意力特征和所述第二卷积结果融合得到所述第二注意力特征。
  8. 行为识别装置,其中,包括:
    抽帧模块,用于对输入视频进行抽帧,得到帧图像;
    融合图像获取模块,用于对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
    特征提取模块,用于将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个第一特征提取模块,所述第二分支包括N个第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
    分类模块,用于对所述目标特征进行分类,得到行为识别结果。
  9. 行为识别设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如下步骤:
    对输入视频进行抽帧,得到帧图像;
    对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
    将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个基于注意力机制的第一特征提取模块,所述第二分支包括N个基于注意力机制的第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出,第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
    对所述目标特征进行分类,得到行为识别结果。
  10. 根据权利要求9所述的行为识别设备,其中,所述对所述帧图像的每个像素的所述颜 色信息和所述光流信息进行融合得到融合图像,包括:
    对所述帧图像的每个像素,根据所述颜色信息得到每个颜色通道的第一元素值;
    对所述帧图像的每个像素,在每个所述颜色通道中,将所述像素的光流信息与所述像素的第一元素值作相乘融合得到所述像素的第二元素值,对所述第二元素值作标准化处理得到目标元素值;
    将所述像素的所有所述颜色通道的所述目标元素值组合得到所述融合图像。
  11. 根据权利要求10所述的行为识别设备,其中,所述对所述第二元素值作标准化处理得到目标元素值,包括:
    计算所述第二元素值的均值;
    计算所述第二元素值的方差;
    将所述第二元素值与所述均值之差除以所述方差,得到所述目标元素值。
  12. 根据权利要求9所述的行为识别设备,其中,所述将所述融合图像输入至特征提取网络进行特征提取得到目标特征,包括:
    将所述融合图像进行降采样率处理得到第二融合图像,将所述第二融合图像输入至所述第一分支得到所述第一特征;
    将所述融合图像输入至所述第二分支得到所述第二特征;
    通过所述融合模块将所述第一特征和所述第二特征拼接,得到所述目标特征。
  13. 根据权利要求12所述的行为识别设备,其中,所述将所述第二融合图像输入至所述第一分支得到所述第一特征,包括:
    使所述第二融合图像依次经过N个所述第一特征提取模块进行特征提取得到所述第一特征;
    其中,经过所述第一特征提取模块进行特征提取,包括:
    使第一输入特征经过至少一个第一卷积层进行卷积运算得到第一卷积结果,所述第一输入特征为输入至所述第一特征提取模块的特征;
    使所述第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征;
    将所述第一注意力特征和所述第一输入特征融合得到第一输出特征,所述第一输出特征为所述第一特征提取模块输出的特征。
  14. 根据权利要求13所述的行为识别设备,其中,将所述融合图像输入至所述第二分支得到所述第二特征,包括:
    使所述融合图像依次经过N个所述第二特征提取模块进行特征提取得到所述第二特征;
    其中,经过所述第二特征提取模块进行特征提取,包括:
    使第二输入特征经过至少一个第二卷积层进行卷积运算得到第二卷积结果,所述第二输入特征为输入至所述第二特征提取模块的特征;
    使所述第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征;
    将所述第二注意力特征和所述第二输入特征融合得到第二输出特征,所述第二输出特征为所述第二特征提取模块输出的特征。
  15. 存储介质,其中,存储有计算机程序,所述计算机程序用于执行如下步骤:
    对输入视频进行抽帧,得到帧图像;
    对每个所述帧图像,获取所述帧图像的颜色信息和光流信息,对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像;
    将所述融合图像输入至特征提取网络进行特征提取得到目标特征,其中所述特征提取网络包括第一分支、第二分支和融合模块,所述第一分支用于提取表示所述输入视频的时间维度信息的第一特征,所述第二分支用于提取表示所述输入视频的空间维度信息的第二特征,所述融合模块用于融合所述第一特征和所述第二特征得到所述目标特征,所述第一分支包括N个基于注意力机制的第一特征提取模块,所述第二分支包括N个基于注意力机制的第二特征提取模块,第n个所述第一特征提取模块的输入为第n-1个所述第一特征提取模块的输出, 第n个所述第二特征提取模块的输入为第n-1个所述第一特征提取模块的输出与第n-1个所述第二特征提取模块的输出两者的融合结果,N为大于或等于2的整数,n为2至N之间的整数;
    对所述目标特征进行分类,得到行为识别结果。
  16. 根据权利要求15所述的存储介质,其中,所述对所述帧图像的每个像素的所述颜色信息和所述光流信息进行融合得到融合图像,包括:
    对所述帧图像的每个像素,根据所述颜色信息得到每个颜色通道的第一元素值;
    对所述帧图像的每个像素,在每个所述颜色通道中,将所述像素的光流信息与所述像素的第一元素值作相乘融合得到所述像素的第二元素值,对所述第二元素值作标准化处理得到目标元素值;
    将所述像素的所有所述颜色通道的所述目标元素值组合得到所述融合图像。
  17. 根据权利要求16所述的存储介质,其中,所述对所述第二元素值作标准化处理得到目标元素值,包括:
    计算所述第二元素值的均值;
    计算所述第二元素值的方差;
    将所述第二元素值与所述均值之差除以所述方差,得到所述目标元素值。
  18. 根据权利要求15所述的存储介质,其中,所述将所述融合图像输入至特征提取网络进行特征提取得到目标特征,包括:
    将所述融合图像进行降采样率处理得到第二融合图像,将所述第二融合图像输入至所述第一分支得到所述第一特征;
    将所述融合图像输入至所述第二分支得到所述第二特征;
    通过所述融合模块将所述第一特征和所述第二特征拼接,得到所述目标特征。
  19. 根据权利要求18所述的存储介质,其中,所述将所述第二融合图像输入至所述第一分支得到所述第一特征,包括:
    使所述第二融合图像依次经过N个所述第一特征提取模块进行特征提取得到所述第一特征;
    其中,经过所述第一特征提取模块进行特征提取,包括:
    使第一输入特征经过至少一个第一卷积层进行卷积运算得到第一卷积结果,所述第一输入特征为输入至所述第一特征提取模块的特征;
    使所述第一卷积结果经过第一注意力机制模块进行特征提取得到第一注意力特征;
    将所述第一注意力特征和所述第一输入特征融合得到第一输出特征,所述第一输出特征为所述第一特征提取模块输出的特征。
  20. 根据权利要求19所述的存储介质,其中,将所述融合图像输入至所述第二分支得到所述第二特征,包括:
    使所述融合图像依次经过N个所述第二特征提取模块进行特征提取得到所述第二特征;
    其中,经过所述第二特征提取模块进行特征提取,包括:
    使第二输入特征经过至少一个第二卷积层进行卷积运算得到第二卷积结果,所述第二输入特征为输入至所述第二特征提取模块的特征;
    使所述第二卷积结果经过第二注意力机制模块进行特征提取得到第二注意力特征;
    将所述第二注意力特征和所述第二输入特征融合得到第二输出特征,所述第二输出特征为所述第二特征提取模块输出的特征。
PCT/CN2022/090714 2022-01-18 2022-04-29 基于特征融合的行为识别方法、装置、设备及存储介质 WO2023137915A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210055992.2 2022-01-18
CN202210055992.2A CN114399839A (zh) 2022-01-18 2022-01-18 基于特征融合的行为识别方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023137915A1 true WO2023137915A1 (zh) 2023-07-27

Family

ID=81231104

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090714 WO2023137915A1 (zh) 2022-01-18 2022-04-29 基于特征融合的行为识别方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114399839A (zh)
WO (1) WO2023137915A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912636A (zh) * 2023-09-12 2023-10-20 深圳须弥云图空间科技有限公司 目标识别方法及装置
CN117835012A (zh) * 2023-12-27 2024-04-05 北京智象未来科技有限公司 可控视频生成方法、装置、设备、存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114399839A (zh) * 2022-01-18 2022-04-26 平安科技(深圳)有限公司 基于特征融合的行为识别方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105913456A (zh) * 2016-04-12 2016-08-31 西安电子科技大学 基于区域分割的视频显著性检测方法
CN110909594A (zh) * 2019-10-12 2020-03-24 杭州电子科技大学 一种基于深度融合的视频显著性检测方法
CN112990116A (zh) * 2021-04-21 2021-06-18 四川翼飞视科技有限公司 基于多注意力机制融合的行为识别装置、方法和存储介质
CN113792680A (zh) * 2021-09-17 2021-12-14 平安科技(深圳)有限公司 基于图像融合的行为识别方法、装置、电子设备及介质
CN114399839A (zh) * 2022-01-18 2022-04-26 平安科技(深圳)有限公司 基于特征融合的行为识别方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105913456A (zh) * 2016-04-12 2016-08-31 西安电子科技大学 基于区域分割的视频显著性检测方法
CN110909594A (zh) * 2019-10-12 2020-03-24 杭州电子科技大学 一种基于深度融合的视频显著性检测方法
CN112990116A (zh) * 2021-04-21 2021-06-18 四川翼飞视科技有限公司 基于多注意力机制融合的行为识别装置、方法和存储介质
CN113792680A (zh) * 2021-09-17 2021-12-14 平安科技(深圳)有限公司 基于图像融合的行为识别方法、装置、电子设备及介质
CN114399839A (zh) * 2022-01-18 2022-04-26 平安科技(深圳)有限公司 基于特征融合的行为识别方法、装置、设备及存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912636A (zh) * 2023-09-12 2023-10-20 深圳须弥云图空间科技有限公司 目标识别方法及装置
CN116912636B (zh) * 2023-09-12 2023-12-12 深圳须弥云图空间科技有限公司 目标识别方法及装置
CN117835012A (zh) * 2023-12-27 2024-04-05 北京智象未来科技有限公司 可控视频生成方法、装置、设备、存储介质

Also Published As

Publication number Publication date
CN114399839A (zh) 2022-04-26

Similar Documents

Publication Publication Date Title
US10936919B2 (en) Method and apparatus for detecting human face
WO2023137915A1 (zh) 基于特征融合的行为识别方法、装置、设备及存储介质
US11825033B2 (en) Apparatus and method with artificial intelligence for scaling image data
CN107992842B (zh) 活体检测方法、计算机装置及计算机可读存储介质
WO2021238631A1 (zh) 物品信息的显示方法、装置、设备及可读存储介质
US11798145B2 (en) Image processing method and apparatus, device, and storage medium
US20220028031A1 (en) Image processing method and apparatus, device, and storage medium
CN111026914B (zh) 视频摘要模型的训练方法、视频摘要生成方法及装置
EP3923233A1 (en) Image denoising method and apparatus
CN112215171B (zh) 目标检测方法、装置、设备及计算机可读存储介质
US20220157041A1 (en) Image classification method and apparatus
WO2022073282A1 (zh) 一种基于特征交互学习的动作识别方法及终端设备
CN108875900A (zh) 视频图像处理方法和装置、神经网络训练方法、存储介质
CN111742345A (zh) 通过着色的视觉跟踪
CN111539290A (zh) 视频动作识别方法、装置、电子设备及存储介质
US11804032B2 (en) Method and system for face detection
US11468571B2 (en) Apparatus and method for generating image
WO2023231182A1 (zh) 图像处理方法、装置、计算机设备、存储介质及程序产品
CN110942037A (zh) 一种用于视频分析中的动作识别方法
CN111507149B (zh) 基于表情识别的交互方法、装置和设备
US20240161461A1 (en) Object detection method, object detection apparatus, and object detection system
US20220164934A1 (en) Image processing method and apparatus, device, video processing method and storage medium
CN114782995A (zh) 一种基于自注意力机制的人交互行为检测方法
Harish et al. Real-Time Semantic Edge Segmentation Using Modified Channelwise Feature Pyramid
US11908036B2 (en) Refining image acquisition data through domain adaptation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22921346

Country of ref document: EP

Kind code of ref document: A1