Optical flow-based violent throwing detection method, device, equipment and storage medium

By converting the frame image stream into a grayscale sequence and detecting the throwing action based on the behavior recognition model, combined with the logistic regression model to calculate the recognition score, the problem of low manual monitoring efficiency in the existing technology is solved, and efficient detection of violently thrown express items is achieved. .

CN112308885BActive Publication Date: 2024-09-27SF TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN201910691116.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-29
Publication Date
2024-09-27
Estimated Expiration
2039-07-29

AI Technical Summary

Technical Problem

In the existing technology, relying on manual monitoring video data to detect violently thrown express items is inefficient, resulting in low alarm accuracy, high false alarm and false alarm rates, and high costs.

Method used

By converting the frame image stream into a grayscale sequence, an optical flow stack is formed, and the throwing action is detected based on the behavior recognition model, the confidence score is calculated, and the throwing recognition score is calculated based on the logistic regression model to achieve video-level violent throwing detection.

Benefits of technology

It reduces the dependence on manual monitoring, improves detection efficiency, reduces false positive and false negative rates, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112308885B
    Figure CN112308885B
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for detecting violent throwing based on optical flow, the method comprising converting a parsed frame image stream into a grayscale sequence, and stacking the grayscale sequences to form an optical flow pile when the number of grayscale sequences reaches a preset number; based on a behavior recognition model, detecting the throwing action of the fragments in the optical flow pile and calculating the confidence score corresponding to the throwing action, and the confidence score is used to characterize the severity of the violent throwing; calculating the throwing recognition score according to the confidence score corresponding to the throwing action and a pre-trained logistic regression model. The embodiment of the present application sparsely samples a series of short clips from the entire video, and each short clip makes a preliminary prediction of the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips, which can detect whether there is a phenomenon of violent throwing of express parcels, and avoid the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of computer vision technology, and specifically relates to a violent throwing detection method, device, equipment and storage medium based on optical flow. Background Art

[0002] In modern society, people are increasingly using express delivery to send and receive items. Especially with the booming development of e-commerce, online shopping has been rapidly popularized and applied. Online shopping uses express delivery to deliver goods to customers, which greatly facilitates people's daily lives.

[0003] At a time when the service quality and sorting efficiency of the express delivery industry are constantly improving, the industry's stubborn problem of violent sorting still exists. Since violent throwing can damage express parcels, this behavior not only causes huge economic losses to express delivery companies, but also affects the industry image of express delivery companies.

[0004] At present, in order to standardize the operation process of express delivery sorting, most express delivery companies have installed camera systems at the sorting sites, and manually identify and monitor video images to investigate violent sorting. However, relying solely on manual analysis of large amounts of video data not only consumes a lot of manpower and material resources, but also causes fatigue and extremely low efficiency due to long-term manual monitoring, resulting in low alarm accuracy, high missed alarm rate and false alarm rate. Summary of the invention

[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a method, device, equipment and storage medium for detecting violent throwing based on optical flow, sparsely sampling a series of short clips from the entire video, and each short clip makes a preliminary prediction on the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips, and can detect whether there is a phenomenon of violent throwing of express parcels, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0006] In a first aspect, the present application provides a violent throwing detection method based on optical flow, comprising:

[0007] Converting the parsed frame image stream into a grayscale sequence, and when the number of the grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile;

[0008] Based on the behavior recognition model, detecting the throwing action of the fragment in the optical flow pile, and calculating the confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing;

[0009] A throwing recognition score is calculated based on the confidence score corresponding to the throwing action and a pre-trained logistic regression model.

[0010] In a second aspect, the present application provides a violent throwing detection device based on optical flow, comprising:

[0011] A conversion module, used for converting the parsed frame image stream into a grayscale sequence, and when the number of the grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile;

[0012] A detection module, configured to detect the throwing action of the fragment in the optical flow pile based on a behavior recognition model, and calculate a confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing;

[0013] A calculation module is used to calculate a throwing recognition score according to a confidence score corresponding to the throwing action and a pre-trained logistic regression model.

[0014] In a third aspect, the present application provides a device, including:

[0015] one or more processors;

[0016] a memory for storing one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors execute the optical flow-based violent throwing detection method as described in the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to implement the steps of the violent throwing detection method based on optical flow as described in the first aspect.

[0019] In summary, the violent throwing detection method, device, equipment and storage medium based on optical flow provided in the embodiments of the present application sparsely samples a series of short clips from the entire video, and each short clip makes a preliminary prediction on the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips; based on this, in the embodiments of the present application, the parsed frame image stream is converted into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, the grayscale sequences are stacked to form an optical flow pile; then, based on the behavior recognition model, the throwing action of the fragment in the optical flow pile is detected and the confidence score corresponding to the throwing action is calculated, and the confidence score is used to characterize the severity of the violent throwing; further, according to the confidence score corresponding to the throwing action and the pre-trained logistic regression model, the throwing recognition score is comprehensively calculated, which can detect whether there is a phenomenon of violent throwing of express parcels, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0021] Figure 1 A basic flow chart of a violent throwing detection method based on optical flow provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a flow chart of another violent throwing detection method based on optical flow provided in an embodiment of the present application;

[0023] Figure 3 A violent throwing detection device based on optical flow is provided in an embodiment of the present application;

[0024] Figure 4 Another violent throwing detection device based on optical flow provided in an embodiment of the present application;

[0025] Figure 5 Another violent throwing detection device based on optical flow is provided in an embodiment of the present application;

[0026] Figure 6 A computer system is provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION

[0027] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0029] The embodiment of the present application provides a violent throwing detection method based on optical flow, which is applied in a terminal. It should be noted that the terminal involved in the embodiment of the present application may include but is not limited to a personal computer (PC), a personal digital assistant (PDA), a tablet computer, a wireless handheld device, and a mobile phone.

[0030] For ease of understanding and explanation, the following Figures 1 to 5 The violent throwing detection method and device based on optical flow provided in the embodiments of the present application are described in detail.

[0031] Please refer to Figure 1, which is a basic flow diagram of a violent throwing detection method based on optical flow provided in an embodiment of the present application, the method comprises the following steps:

[0032] S101, converting the parsed frame image stream into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile.

[0033] For example, a camera system is installed at a parcel sorting site, and each camera in the camera system collects a frame image stream. Then, after parsing the frame image stream, it is converted into a grayscale sequence, recorded as an RGB sequence, where the grayscale sequence can weaken the influence of the surrounding environment and highlight the target object. When the number of RGB sequences reaches a preset number, such as 5 frames or 10 frames, the RGB sequences are stacked to form an optical flow pile.

[0034] It should be noted that optical flow is the instantaneous speed of the pixel movement of a moving object in space on the observation imaging plane. It uses the change of pixels in the time domain in the image sequence and the correlation between adjacent frames to find the corresponding relationship between the previous frame and the current frame, thereby calculating the motion information of the object between adjacent frames. Generally speaking, optical flow is caused by the movement of the foreground object itself in the scene, the movement of the camera, or the joint movement of the two. In addition to providing information about the distance between objects, optical flow can also provide information about the angle of movement.

[0035] Furthermore, the structural similarity of adjacent frame images in the frame image stream can be calculated, and when the structural similarity is greater than a preset threshold, a frame image is selected from the adjacent frame images to be added to the conversion queue. If adjacent frame images with the same structural similarity are added to the conversion queue, repeated calculations will be caused, increasing the number of optical flow calculations, thereby reducing the processing speed.

[0036] For example, assuming that the preset threshold is 90%, of course, the preset threshold can also be other values, and the embodiments of the present application do not limit this. For example, frame image 1 and frame image 2 are two adjacent frame images in the frame image stream. After calculation, the structural similarity of the two frame images is 95%, which is greater than the preset threshold of 90%. Therefore, any frame image is selected from frame image 1 and frame image 2 to add to the conversion queue, which can speed up the processing speed, reduce the number of optical flow calculations, and has no effect on the detection of violent throwing events.

[0037] It should be noted that the Structural Similarity IndexMeasurement is an indicator to measure the similarity between two images. Natural images are highly structural, which is reflected in the strong correlation between the pixels of the image. Especially in the case of spatial similarity, these correlations carry important information about the structure of the target object in the visual scene.

[0038] Furthermore, in the embodiment of the present application, the size of the grayscale sequence is adjusted so that the size of the grayscale sequence is equal to the size of the network input image. Compared with the size of the grayscale sequence, the size of the network input image is much smaller. For example, the size of the picture in the camera is on the order of 1280*960, while the size of the network input image is on the order of 560*420. This can speed up the processing progress while having little effect on the calculation accuracy of the optical flow. Since the accuracy of the optical flow is not positively correlated with the recognition accuracy of the action classification, better recognition accuracy may also be achieved when the accuracy of the optical flow is lower. After testing the behavior recognition model, better recognition accuracy can be achieved when the aspect ratio of the picture is 4:3.

[0039] S102, based on the behavior recognition model, detecting the throwing action of the fragment in the optical flow pile, and calculating the confidence score corresponding to the throwing action.

[0040] Among them, the confidence score is used to characterize the severity of violent throwing.

[0041] For example, in the embodiments of the present application, the Temporal Segment Networks (TSN) is used as a framework for explanation. First, the optical flow pile is divided into several segments at equal intervals, and segments are randomly sampled from the segments; then, according to the spatial stream convolutional network and the temporal stream convolutional network in the behavior recognition model, the throwing action of the segment in the optical flow pile is identified, and the confidence score corresponding to the throwing action is calculated.

[0042] For example, first divide the optical flow pile into 3 segments, and a snippet is randomly sampled from its corresponding segment, namely, snippet 1, snippet 2 and snippet 3; then snippet 1, snippet 2 and snippet 3 are used as the input of the behavior recognition model, and the spatial stream convolutional network and the temporal stream convolutional network are used to identify the throwing action to determine whether there is a phenomenon of violent throwing in the sorting process of the express mail, that is, no throwing and serious throwing; then, the fully connected layer recognition data of the time series network is obtained, and the result of the quotient of the fully connected layer recognition data and the experience value is used as the confidence score corresponding to the throwing action. Among them, the experience value is related to the degree of training of the behavior recognition model, for example, the experience value can be 5, or it can be any other positive number. In addition, since the data set for behavior detection is relatively small, there is a risk of overfitting during training. For this reason, in the embodiment of the present application, one of the cross input mode and training, batch normalization (Batch Normalization, BN) and data enhancement can be used to solve the problem of overfitting. Of course, the behavior recognition model can also be a deep temporal linear encoding network (Deep TemporalLinearEncodingNetworks). As a behavior recognition model for video action recognition, as long as it can use optical flow for input, the embodiments of the present application do not limit this.

[0043] S103, calculating a throwing recognition score according to the confidence score corresponding to the throwing action and a pre-trained logistic regression model.

[0044] For example, in the embodiment of the present application, the confidence score corresponding to the throwing action is input into the logistic regression model to obtain the throwing recognition score. Therefore, the embodiment of the present application can judge whether it is violent throwing by the score, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0045] It should be noted that in the logistic regression model y=wx+b, the coefficients w and b are obtained through continuous deep learning based on the vector of the fully connected layer of the convolutional network as input. For example, the fully connected layer vector of each sample is obtained on the training sample. Here, the samples are divided into two categories: severe throwing and non-severe throwing, and the logistic regression model is obtained by fitting. If the samples are multi-classified, for example, they are divided into three categories according to the degree of throwing: no throwing, slight throwing, and severe throwing. No throwing can be treated as one category, and slight throwing and severe throwing can be treated as another category.

[0046] The violent throwing detection method based on optical flow provided in the embodiment of the present application sparsely samples a series of short clips from the entire video, and each short clip makes a preliminary prediction on the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips; based on this, in the embodiment of the present application, the parsed frame image stream is converted into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, the grayscale sequences are stacked to form an optical flow pile; then, based on the behavior recognition model, the throwing action of the fragments in the optical flow pile is detected and the confidence score corresponding to the throwing action is calculated, and the confidence score is used to characterize the severity of the violent throwing; further, according to the confidence score corresponding to the throwing action and the pre-trained logistic regression model, the throwing recognition score is comprehensively calculated, which can detect whether there is a phenomenon of violent throwing of express parcels, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0047] Based on the above embodiments, the present application provides another method for detecting violent throwing based on optical flow, as shown in FIG. Figure 2 As shown, the method comprises the following steps:

[0048] S201, converting the parsed frame image stream into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile.

[0049] It should be noted that in other embodiments of the present application, the structural similarity of adjacent frame images in the frame image stream may also be calculated, and when the structural similarity is greater than a preset threshold, a frame image is selected from the adjacent frame images to be added to the conversion queue. If adjacent frame images with the same structural similarity are added to the conversion queue, repeated calculations will be caused, increasing the number of optical flow calculations, thereby reducing the processing speed.

[0050] Furthermore, in the embodiment of the present application, the size of the grayscale sequence is adjusted so that the size of the grayscale sequence is equal to the size of the network input image. Compared with the size of the grayscale sequence, the size of the network input image is much smaller. For example, the size of the image in the camera is in the order of 1280*960, while the size of the network input image is in the order of 560*420. This can speed up the processing progress and has little effect on the calculation accuracy of the optical flow.

[0051] S202, dividing the optical flow pile into a number of segments at equal intervals, and randomly sampling from the segments to obtain fragments.

[0052] S203, identifying the throwing action of the fragment in the optical flow pile according to the spatial stream convolutional network and the temporal stream convolutional network in the behavior recognition model, and calculating the confidence score corresponding to the throwing action.

[0053] Specifically, in the embodiment of the present application, after the fragment is obtained through training of the spatial stream convolutional network and the temporal stream convolutional network, the fully connected layer vectors corresponding to the spatial stream and the temporal stream are obtained; then, the confidence score is calculated based on the fully connected layer vectors.

[0054] For example, first, the optical flow pile is divided into three segments, and a snippet is randomly sampled from its corresponding segment, namely, snippet 1, snippet 2 and snippet 3; then, snippet 1, snippet 2 and snippet 3 are used as the input of the behavior recognition model, and the spatial stream convolutional network and the temporal stream convolutional network are used to identify the throwing action to determine whether there is violent throwing of the express during the sorting process, namely, no throwing and severe throwing; then, the fully connected layer recognition data of the time series network is obtained, and the result of the quotient of the fully connected layer recognition data and the empirical value is used as the confidence score corresponding to the throwing action.

[0055] S204, calculating a throwing recognition score according to the confidence score corresponding to the throwing action and a pre-trained logistic regression model.

[0056] For example, in the embodiment of the present application, the confidence score corresponding to the throwing action is input into the logistic regression model to obtain the throwing recognition score. Therefore, the embodiment of the present application can judge whether it is violent throwing by the score, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0057] In the logistic regression model y=wx+b, the coefficients w and b are obtained through continuous deep learning based on the vector of the fully connected layer of the convolutional network as input. For example, the fully connected layer vector of each sample is obtained on the training sample. Here, the samples are divided into two categories: severe throwing and non-severe throwing, and the logistic regression model is obtained by fitting. If the samples are multi-classified, for example, they are divided into three categories according to the degree of throwing: no throwing, slight throwing, and severe throwing. No throwing can be treated as one category, and slight throwing and severe throwing can be treated as another category.

[0058] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0059] Based on the foregoing embodiments, an embodiment of the present application provides a device, the device comprising one or more processors;

[0060] a memory for storing one or more programs,

[0061] When one or more programs are executed by one or more processors, the one or more processors execute the above-mentioned violent throwing detection method based on optical flow.

[0062] The optical flow-based violent throwing detection method provided in the embodiment of the present application sparsely samples a series of short clips from the entire video, and each short clip makes a preliminary prediction on the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips. It can detect whether there is a phenomenon of violent throwing of express parcels, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0063] Based on the above embodiments, the present application provides a violent throwing detection device based on optical flow, which can be applied to Figures 1-2 The corresponding embodiment provides a method for detecting violent throwing based on optical flow. Figure 3 As shown, the violent throwing detection device 3 based on optical flow includes:

[0064] A conversion module 31, used for converting the parsed frame image stream into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile;

[0065] A detection module 32, for detecting the throwing action of the fragment in the optical flow pile based on the behavior recognition model, and calculating the confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing;

[0066] The calculation module 33 is used to calculate the throwing recognition score according to the confidence score corresponding to the throwing action and the pre-trained logistic regression model.

[0067] In other embodiments of the present application, Figure 4 As shown, the detection module 32 includes:

[0068] A sampling unit 321 is used to divide the optical flow pile into a number of segments at equal intervals, and randomly sample from the segments to obtain fragments;

[0069] The calculation unit 322 is used to identify the throwing action of the fragment in the optical flow pile according to the spatial stream convolution network and the temporal stream convolution network in the behavior recognition model, and calculate the confidence score corresponding to the throwing action.

[0070] In other embodiments of the present application, the computing unit 322 is specifically used to obtain the corresponding fully connected layer vectors on the spatial stream and the temporal stream after the fragment is trained by the spatial stream convolutional network and the temporal stream convolutional network, and calculate the confidence score based on the fully connected layer vector.

[0071] In other embodiments of the present application, the conversion module 31 is further used to calculate the structural similarity of adjacent frame images in the frame image stream;

[0072] When the structural similarity is greater than a preset threshold, a frame image is selected from adjacent frame images and added to the conversion queue.

[0073] In other embodiments of the present application, Figure 5 As shown, the violent throwing detection device 3 based on optical flow also includes:

[0074] The adjustment module 34 is used to adjust the size of the grayscale sequence so that the size of the grayscale sequence is equal to the size of the network input image.

[0075] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0076] The violent throwing detection device based on optical flow provided in the embodiment of the present application sparsely samples a series of short clips from the entire video, and each short clip makes a preliminary prediction on the degree of violent throwing, so as to obtain a video-level prediction result based on the consensus of these short clips; based on this, in the embodiment of the present application, the parsed frame image stream is converted into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, the grayscale sequences are stacked to form an optical flow pile; then, based on the behavior recognition model, the throwing action of the fragments in the optical flow pile is detected and the confidence score corresponding to the throwing action is calculated, and the confidence score is used to characterize the severity of the violent throwing; further, according to the confidence score corresponding to the throwing action and the pre-trained logistic regression model, the throwing recognition score is comprehensively calculated, which can detect whether there is a phenomenon of violent throwing of express parcels, avoiding the problem of relying solely on manual monitoring, which is highly subjective and extremely inefficient.

[0077] Based on the above embodiments, the present application provides a computer system. Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion into a random access memory (RAM) 603. Various programs and data required for system operation are also stored in the RAM 603. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0078] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0079] In particular, according to the embodiments of the present application, the above reference process Figures 1-2 The described process may be implemented as a computer software program. For example, Embodiment 1 of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program is executed by CPU 601 to implement the following steps:

[0080] Convert the parsed frame image stream into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, stack the grayscale sequences to form an optical flow pile;

[0081] Based on the behavior recognition model, the throwing action of the fragment in the optical flow pile is detected, and the confidence score corresponding to the throwing action is calculated; the confidence score is used to characterize the severity of violent throwing;

[0082] The throwing recognition score is calculated based on the confidence score corresponding to the throwing action and the pre-trained logistic regression model.

[0083] In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 609 , and / or installed from the removable medium 611 .

[0084] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0085] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the violent throwing detection device, method and computer program product based on optical flow according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0086] The units involved in the embodiments described in the present application may be implemented by software or hardware, and the units described may also be provided in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves. The units or modules described may also be provided in a processor, for example, may be described as: a processor includes a conversion module, a detection module, and a calculation module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0087] As another aspect, the present application also provides a computer-readable medium, which may be included in the terminal described in the above embodiment; or may exist independently without being assembled into the terminal. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a terminal, the terminal implements the violent throwing detection method based on optical flow as in the above embodiment.

[0088] For example, the terminal can implement Figure 1 As shown in: S101, converting the parsed frame image stream into a grayscale sequence, and when the number of grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile; S102, based on the behavior recognition model, detecting the throwing action of the fragments in the optical flow pile, and calculating the confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing; S103, calculating the throwing recognition score according to the confidence score corresponding to the throwing action and the pre-trained logistic regression model. For another example, the terminal can implement the following Figure 2 The steps shown in .

[0089] It should be noted that, although several modules or units of the terminal for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0090] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0091] Through the description of the above implementations, those skilled in the art can easily understand that the example implementations described here can be implemented by software, or by combining software with necessary hardware.

[0092] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.

Claims

1. A violent throwing detection method based on optical flow, characterized in that: The method comprises: Converting the parsed frame image stream into a grayscale sequence, and when the number of the grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile; Based on the behavior recognition model, detecting the throwing action of the fragment in the optical flow pile, and calculating the confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing; Calculating a throwing recognition score according to the confidence score corresponding to the throwing action and a pre-trained logistic regression model; The detecting the throwing action of the fragment in the optical flow pile based on the behavior recognition model and calculating the confidence score corresponding to the throwing action includes: Dividing the optical flow pile into a plurality of segments at equal intervals, and randomly sampling from the segments to obtain the fragments; According to the spatial stream convolutional network and the temporal stream convolutional network in the behavior recognition model, the throwing action of the fragment in the optical flow pile is identified, and the confidence score corresponding to the throwing action is calculated.

2. The optical flow-based violent throwing detection method according to claim 1 is characterized in that: The identifying the throwing action of the fragment in the optical flow pile according to the spatial stream convolution network and the temporal stream convolution network in the behavior recognition model and calculating the confidence score corresponding to the throwing action includes: Obtaining fully connected layer vectors corresponding to the spatial stream and the temporal stream obtained after the segment is trained by the spatial stream convolutional network and the temporal stream convolutional network; The confidence score is calculated based on the fully connected layer vector.

3. The optical flow-based violent throwing detection method according to claim 1 is characterized in that: The method of converting the parsed frame image stream into a grayscale sequence, and stacking the grayscale sequences to form an optical flow pile when the number of the grayscale sequences reaches a preset number, further includes: Calculating structural similarities of adjacent frame images in the frame image stream; When the structural similarity is greater than a preset threshold, a frame image is selected from the adjacent frame images and added to a conversion queue.

4. The violent throwing detection method based on optical flow according to any one of claims 1 to 3, characterized in that: The method further comprises: The size of the grayscale sequence is adjusted so that the size of the grayscale sequence is equal to the size of the network input image.

5. A violent throwing detection device based on optical flow, characterized in that: The device comprises: A conversion module, used for converting the parsed frame image stream into a grayscale sequence, and when the number of the grayscale sequences reaches a preset number, stacking the grayscale sequences to form an optical flow pile; A detection module, configured to detect the throwing action of the fragment in the optical flow pile based on a behavior recognition model, and calculate a confidence score corresponding to the throwing action; wherein the confidence score is used to characterize the severity of violent throwing; A calculation module, used to calculate a throwing recognition score according to a confidence score corresponding to the throwing action and a pre-trained logistic regression model; The detection module comprises: A sampling unit, used for dividing the optical flow pile into a plurality of segments at equal intervals, and randomly sampling from the segments to obtain the fragments; A computing unit is used to identify the throwing action of the fragment in the optical flow pile according to the spatial stream convolution network and the temporal stream convolution network in the behavior recognition model, and calculate the confidence score corresponding to the throwing action.

6. The optical flow-based violent throwing detection device according to claim 5, characterized in that: The calculation unit is specifically used to obtain the fully connected layer vector corresponding to the spatial stream and the temporal stream obtained after the segment is trained by the spatial stream convolutional network and the temporal stream convolutional network; The confidence score is calculated based on the fully connected layer vector.

7. A device, characterized in that: The device comprises: one or more processors; a 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 enabled to perform the violent throwing detection method based on optical flow as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to implement the steps of the violent throwing detection method based on optical flow as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Video analysis based abnormal behavior detection method and system

    CN104123544A

  • CNN-based video identification and classification method through time-space significant information fusion

    CN105550699A

  • Spatio-temporal data stream video behavior recognition method based on deep learning

    CN105678216A

  • Method for detecting video action based on convolutional neural network

    CN106897714A

  • Human behavior recognition method integrating space-time dual-network flow and attention mechanism

    CN107609460A