CN110659561A - Optimization method and device of internet riot and terrorist video identification model - Google Patents

Optimization method and device of internet riot and terrorist video identification model Download PDF

Info

Publication number
CN110659561A
CN110659561A CN201910725251.9A CN201910725251A CN110659561A CN 110659561 A CN110659561 A CN 110659561A CN 201910725251 A CN201910725251 A CN 201910725251A CN 110659561 A CN110659561 A CN 110659561A
Authority
CN
China
Prior art keywords
parameters
quantization
riot
data
internet
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910725251.9A
Other languages
Chinese (zh)
Inventor
李扬曦
佟玲玲
井雅琪
缪亚男
段运强
胡燕林
任博雅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Computer Network and Information Security Management Center
Original Assignee
National Computer Network and Information Security Management Center
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 National Computer Network and Information Security Management Center filed Critical National Computer Network and Information Security Management Center
Priority to CN201910725251.9A priority Critical patent/CN110659561A/en
Publication of CN110659561A publication Critical patent/CN110659561A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses an optimization method and device of an internet riot and terrorist video identification model, wherein the method comprises the following steps: acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model; and judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation. The invention greatly improves the data volume audited by using the riot model every day. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.

Description

Optimization method and device of internet riot and terrorist video identification model
Technical Field
The invention relates to the technical field of computers, in particular to an optimization method and device of an internet riot and terrorist video identification model.
Background
Nowadays, the internet brings great convenience to the life of people, but simultaneously, many lawbreakers use the internet to publish some videos which publicize extreme, terrorism or have violent terrorism pictures, which causes great harm to the internet surfing experience of common people, meanwhile, the videos are easy to arouse the bad emotion of individuals to cause terrorism activities, and further, the videos form great challenges to peace, stability and public security of the country. Therefore, the identification of the riot and terrorist videos from a large number of videos uploaded to the internet by netizens and the timely blocking and killing and the later filing of some potential lawless persons are of great significance, but at the same time, the work consumes manpower and material resources because the data volume uploaded to the network every day is huge, however, the various defects of manual audit before are greatly relieved by the automatic machine identification of the riot and terrorist videos by applying deep learning at present, and the acceleration and compression of the riot and terrorist identification model are of great significance because the data volume needing to be audited every day is huge.
The existing riot and terrorist identification model is an image identification classifier, a video is firstly extracted into frames to form pictures, and then the picture riot and terrorist identification model is divided into two categories of riot and terrorist and normal. Specifically, the image classifier is a deep convolutional neural network, the input of the model is an image, the model outputs scores of two categories of an explosion category and a normal category, and the score of the high-ranked person is obtained as the judgment category of the image. However, in order to make the recognition capability of the model strong, the model is relatively complex, the number of parameters is large, and the calculation speed is slow each time.
In summary, the disadvantages of the prior art are mainly as follows: the existing riot and terrorist recognition model is too high in complexity and large in calculation amount, so that too many machine resources are consumed for auditing the whole network video, and the whole network video is difficult to be truly overhauled. It is therefore of great significance to compress the riot identification model and the acceleration of the model without affecting the model identification capability.
Disclosure of Invention
The embodiment of the invention provides an optimization method and device of an internet riot and terrorist video identification model, which are used for solving the problems in the prior art.
The embodiment of the invention provides an optimization method of an internet riot and terrorist video identification model, which comprises the following steps:
acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model;
and judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation.
Preferably, whether to discard the corresponding channel is determined according to the parameter of each channel, and if yes, the performing the channel discarding operation specifically includes:
and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
Preferably, the method further comprises:
and converting the data and parameters of the Internet riot and terrorist video identification model into an 8-bit integer for processing by a computer.
Preferably, the step of converting the data and parameters of the internet riot and terrorist video identification model into an 8-bit integer for computer processing specifically comprises the following steps:
inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantization parameters and the maximum value and the minimum value of the parameters;
carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and restoring the 8-bit integer into data and parameters of a floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
The embodiment of the invention also provides an optimization device of the internet riot and terrorist video identification model, which comprises the following steps:
the acquiring module is used for acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of the Internet riot and terrorist video identification model;
and the judging module is used for judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation.
Preferably, the determining module is specifically configured to:
and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
Preferably, the apparatus further comprises:
and the Int8 quantization module is used for converting data and parameters of the internet riot and terrorist video identification model into an 8-bit integer for computer processing.
Preferably, the Int8 quantization module is specifically configured to:
inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantization parameters and the maximum value and the minimum value of the parameters;
carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and restoring the 8-bit integer into data and parameters of a floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
The embodiment of the invention also provides an optimization device of the internet riot and terrorist video identification model, which comprises the following steps: the internet riot video identification model optimization method comprises the following steps of a memorizer, a processor and a computer program which is stored on the memorizer and can run on the processor, wherein the computer program realizes the steps of the internet riot video identification model optimization method when being executed by the processor.
The embodiment of the invention also provides a computer-readable storage medium, wherein an implementation program for information transmission is stored on the computer-readable storage medium, and when the implementation program is executed by a processor, the steps of the optimization method for the internet riot and terrorist video identification model are implemented.
By adopting the embodiment of the invention, aiming at the problems of low speed and large model of the existing riot and terrorist identification model, the problem is solved by pruning the convolutional neural network of the internet riot and terrorist video identification model, so that the data volume audited by using the riot and terrorist model every day is greatly improved. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of a method for optimizing an Internet riot video identification model according to an embodiment of the method of the present invention;
FIG. 2 is a schematic diagram of an apparatus for optimizing an Internet riot video recognition model according to a first embodiment of the present invention;
fig. 3 is a schematic diagram of an apparatus for optimizing an internet riot video recognition model according to a second embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Method embodiment
According to an embodiment of the present invention, an optimization method for an internet riot and terrorist video recognition model is provided, fig. 1 is a flowchart of the optimization method for the internet riot and terrorist video recognition model according to the embodiment of the present invention, as shown in fig. 1, the optimization method for the internet riot and terrorist video recognition model according to the embodiment of the present invention specifically includes:
step 101, acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model;
and 102, judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation. Step 102 specifically includes: and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
That is to say, for a convolutional neural network, many parameters in the network are usually redundant, and do not contribute to an actual model result, and each layer of the network usually has convolution kernels of many channels, and if the sum of absolute values of parameters of a certain channel of a convolution kernel is small, that is, each parameter of the channel is small, it is conceivable that the effect of the channel actually playing in the convolution process is very small, so that we can discard the whole channel, thereby achieving the effects of reducing parameters, reducing calculation amount, and accelerating the model, that is, pruning the convolutional neural network model, and the pruning operation generally affects the recognition capability of the model within an acceptable range, and can greatly reduce the complexity of the model and greatly accelerate the model prediction speed.
In order to further optimize the convolutional neural network of the internet riot and terrorist video identification model, preferably, the embodiment of the invention can also convert the data and parameters of the internet riot and terrorist video identification model into 8-bit integers for processing by a computer. The method specifically comprises the following steps:
step 1, inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantized parameters and the maximum value and the minimum value of the parameters;
step 2, carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
step 3, carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and 4, restoring the 8-bit integer into data and parameters of the floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
That is, the parameters of the model are usually stored in the form of float32 in the computer, and if the parameters are changed to 8-bit integers, the computation speed of the CPU processing the integers is faster than that of the floating point numbers, so the network can be compressed and accelerated without changing the number of connections and the number of parameters.
In the embodiment of the present invention, the input data is a floating point type, and first, there are three data quantized by int 8: quantized data, maximum, minimum. Namely, the original floating point number can be recovered through the three data; then, performing quantized convolution operation, wherein 6 quantized data, the maximum and minimum values of the data, the quantization parameters and the maximum and minimum values of the parameters are input, and 3 quantized convolution results (32-bit integers), the maximum values and the minimum values of the quantization results are output; thirdly, the quantization result and the range input thereof are subjected to complex quantization, and the aim is to re-quantize the 32-bit integer into an 8-bit integer; fourth, the 8-bit integer is reduced to a floating point type. In practice the input and output of such a unit are still floating point numbers.
By adopting the embodiment of the invention, aiming at the problems of low speed and large model of the existing riot and terrorist identification model, the problem is solved by pruning the convolutional neural network of the internet riot and terrorist video identification model and carrying out int8 quantization, so that the data volume audited by using the riot and terrorist model every day is greatly improved. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.
Apparatus embodiment one
According to an embodiment of the present invention, an optimization apparatus for an internet riot and terrorist video recognition model is provided, fig. 2 is a schematic diagram of the optimization apparatus for an internet riot and terrorist video recognition model according to an embodiment of the present invention, as shown in fig. 2, the optimization apparatus for an internet riot and terrorist video recognition model according to an embodiment of the present invention specifically includes:
the acquiring module 20 is configured to acquire parameters of each channel of a convolution kernel of each layer in a convolution neural network of the internet riot and terrorist video identification model;
and the judging module 22 is configured to judge whether to discard the corresponding channel according to the parameter of each channel, and if yes, execute a channel discarding operation. The determining module 22 is specifically configured to:
and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
That is to say, for a convolutional neural network, many parameters in the network are usually redundant, and do not contribute to an actual model result, and each layer of the network usually has convolution kernels of many channels, and if the sum of absolute values of parameters of a certain channel of a convolution kernel is small, that is, each parameter of the channel is small, it is conceivable that the effect of the channel actually playing in the convolution process is very small, so that we can discard the whole channel, thereby achieving the effects of reducing parameters, reducing calculation amount, and accelerating the model, that is, pruning the convolutional neural network model, and the pruning operation generally affects the recognition capability of the model within an acceptable range, and can greatly reduce the complexity of the model and greatly accelerate the model prediction speed.
In order to further optimize the convolutional neural network of the internet riot video recognition model, preferably, the apparatus of the embodiment of the present invention further includes:
and the Int8 quantization module is used for converting data and parameters of the internet riot and terrorist video identification model into an 8-bit integer for computer processing. Int8 quantization module is specifically used for:
inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantization parameters and the maximum value and the minimum value of the parameters;
carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and restoring the 8-bit integer into data and parameters of a floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
That is, the parameters of the model are usually stored in the form of float32 in the computer, and if the parameters are changed to 8-bit integers, the computation speed of the CPU processing the integers is faster than that of the floating point numbers, so the network can be compressed and accelerated without changing the number of connections and the number of parameters.
In the embodiment of the present invention, the input data is a floating point type, and first, there are three data quantized by int 8: quantized data, maximum, minimum. Namely, the original floating point number can be recovered through the three data; then, performing quantized convolution operation, wherein 6 quantized data, the maximum and minimum values of the data, the quantization parameters and the maximum and minimum values of the parameters are input, and 3 quantized convolution results (32-bit integers), the maximum values and the minimum values of the quantization results are output; thirdly, the quantization result and the range input thereof are subjected to complex quantization, and the aim is to re-quantize the 32-bit integer into an 8-bit integer; fourth, the 8-bit integer is reduced to a floating point type. In practice the input and output of such a unit are still floating point numbers.
By adopting the embodiment of the invention, aiming at the problems of low speed and large model of the existing riot and terrorist identification model, the problem is solved by pruning the convolutional neural network of the internet riot and terrorist video identification model and carrying out int8 quantization, so that the data volume audited by using the riot and terrorist model every day is greatly improved. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.
Device embodiment II
The embodiment of the invention provides an optimizing device of an internet riot and terrorist video identification model, as shown in fig. 3, comprising: a memory 30, a processor 32 and a computer program stored on the memory 30 and executable on the processor 32, which computer program, when executed by the processor 32, carries out the following method steps:
step 101, acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model;
and 102, judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation. Step 102 specifically includes: and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
That is to say, for a convolutional neural network, many parameters in the network are usually redundant, and do not contribute to an actual model result, and each layer of the network usually has convolution kernels of many channels, and if the sum of absolute values of parameters of a certain channel of a convolution kernel is small, that is, each parameter of the channel is small, it is conceivable that the effect of the channel actually playing in the convolution process is very small, so that we can discard the whole channel, thereby achieving the effects of reducing parameters, reducing calculation amount, and accelerating the model, that is, pruning the convolutional neural network model, and the pruning operation generally affects the recognition capability of the model within an acceptable range, and can greatly reduce the complexity of the model and greatly accelerate the model prediction speed.
In order to further optimize the convolutional neural network of the internet riot and terrorist video identification model, preferably, the embodiment of the invention can also convert the data and parameters of the internet riot and terrorist video identification model into 8-bit integers for processing by a computer. The method specifically comprises the following steps:
step 1, inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantized parameters and the maximum value and the minimum value of the parameters;
step 2, carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
step 3, carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and 4, restoring the 8-bit integer into data and parameters of the floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
That is, the parameters of the model are usually stored in the form of float32 in the computer, and if the parameters are changed to 8-bit integers, the computation speed of the CPU processing the integers is faster than that of the floating point numbers, so the network can be compressed and accelerated without changing the number of connections and the number of parameters.
In the embodiment of the present invention, the input data is a floating point type, and first, there are three data quantized by int 8: quantized data, maximum, minimum. Namely, the original floating point number can be recovered through the three data; then, performing quantized convolution operation, wherein 6 quantized data, the maximum and minimum values of the data, the quantization parameters and the maximum and minimum values of the parameters are input, and 3 quantized convolution results (32-bit integers), the maximum values and the minimum values of the quantization results are output; thirdly, the quantization result and the range input thereof are subjected to complex quantization, and the aim is to re-quantize the 32-bit integer into an 8-bit integer; fourth, the 8-bit integer is reduced to a floating point type. In practice the input and output of such a unit are still floating point numbers.
By adopting the embodiment of the invention, aiming at the problems of low speed and large model of the existing riot and terrorist identification model, the problem is solved by pruning the convolutional neural network of the internet riot and terrorist video identification model and carrying out int8 quantization, so that the data volume audited by using the riot and terrorist model every day is greatly improved. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.
Device embodiment III
The embodiment of the present invention provides a computer-readable storage medium, on which an implementation program for information transmission is stored, and when being executed by a processor 32, the implementation program implements the following method steps:
step 101, acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model;
and 102, judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation. Step 102 specifically includes: and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
That is to say, for a convolutional neural network, many parameters in the network are usually redundant, and do not contribute to an actual model result, and each layer of the network usually has convolution kernels of many channels, and if the sum of absolute values of parameters of a certain channel of a convolution kernel is small, that is, each parameter of the channel is small, it is conceivable that the effect of the channel actually playing in the convolution process is very small, so that we can discard the whole channel, thereby achieving the effects of reducing parameters, reducing calculation amount, and accelerating the model, that is, pruning the convolutional neural network model, and the pruning operation generally affects the recognition capability of the model within an acceptable range, and can greatly reduce the complexity of the model and greatly accelerate the model prediction speed.
In order to further optimize the convolutional neural network of the internet riot and terrorist video identification model, preferably, the embodiment of the invention can also convert the data and parameters of the internet riot and terrorist video identification model into 8-bit integers for processing by a computer. The method specifically comprises the following steps:
step 1, inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantized parameters and the maximum value and the minimum value of the parameters;
step 2, carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
step 3, carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and 4, restoring the 8-bit integer into data and parameters of the floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
That is, the parameters of the model are usually stored in the form of float32 in the computer, and if the parameters are changed to 8-bit integers, the computation speed of the CPU processing the integers is faster than that of the floating point numbers, so the network can be compressed and accelerated without changing the number of connections and the number of parameters.
In the embodiment of the present invention, the input data is a floating point type, and first, there are three data quantized by int 8: quantized data, maximum, minimum. Namely, the original floating point number can be recovered through the three data; then, performing quantized convolution operation, wherein 6 quantized data, the maximum and minimum values of the data, the quantization parameters and the maximum and minimum values of the parameters are input, and 3 quantized convolution results (32-bit integers), the maximum values and the minimum values of the quantization results are output; thirdly, the quantization result and the range input thereof are subjected to complex quantization, and the aim is to re-quantize the 32-bit integer into an 8-bit integer; fourth, the 8-bit integer is reduced to a floating point type. In practice the input and output of such a unit are still floating point numbers.
By adopting the embodiment of the invention, aiming at the problems of low speed and large model of the existing riot and terrorist identification model, the problem is solved by pruning the convolutional neural network of the internet riot and terrorist video identification model and carrying out int8 quantization, so that the data volume audited by using the riot and terrorist model every day is greatly improved. The method fills the blank of the auditing technology and products of the mass internet video riot and terrorist videos, and can greatly improve the product competitiveness of the auditing of the riot and terrorist images.
The computer-readable storage medium of this embodiment includes, but is not limited to: ROM, RAM, magnetic or optical disks, and the like.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An optimization method for an internet riot and terrorist video identification model is characterized by comprising the following steps:
acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of an internet riot and terrorist video identification model;
and judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation.
2. The method of claim 1, wherein whether to discard the corresponding channel is determined according to the parameter of each channel, and if yes, the performing the channel discarding operation specifically includes:
and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
3. The method of claim 1, wherein the method further comprises:
and converting the data and parameters of the Internet riot and terrorist video identification model into an 8-bit integer for processing by a computer.
4. The method of claim 3, wherein converting data and parameters of the internet riot video recognition model into 8-bit integers for computer processing specifically comprises:
inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantization parameters and the maximum value and the minimum value of the parameters;
carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and restoring the 8-bit integer into data and parameters of a floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
5. An optimization device for an internet riot and terrorist video recognition model is characterized by comprising:
the acquiring module is used for acquiring parameters of each channel of a convolution kernel of each layer in a convolution neural network of the Internet riot and terrorist video identification model;
and the judging module is used for judging whether to discard the corresponding channel according to the parameters of each channel, and if so, executing channel discarding operation.
6. The apparatus of claim 5, wherein the determining module is specifically configured to:
and calculating the sum of absolute values of the parameters of the same channel, judging whether the sum of the absolute values is less than or equal to a preset parameter threshold value, and if so, discarding the corresponding channel.
7. The apparatus of claim 5, wherein the apparatus further comprises:
and the Int8 quantization module is used for converting data and parameters of the internet riot and terrorist video identification model into an 8-bit integer for computer processing.
8. The apparatus of claim 7, wherein the Int8 quantization module is specifically configured to:
inputting data and parameters of a floating point number type, and carrying out primary int8 quantization on the data and the parameters to obtain quantized data, the maximum value and the minimum value of the data, quantization parameters and the maximum value and the minimum value of the parameters;
carrying out convolution operation on the quantized data, the maximum value and the minimum value of the data, the quantization parameter and the maximum value and the minimum value of the parameter, and outputting a 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
carrying out complex quantization on the 32-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result to obtain an 8-bit integer quantization convolution result and the maximum value and the minimum value of the quantization result;
and restoring the 8-bit integer into data and parameters of a floating point number type according to the quantized convolution result and the maximum value and the minimum value of the quantized result.
9. An optimization device for an internet riot and terrorist video recognition model is characterized by comprising: memory, processor and computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of optimizing an internet riot video recognition model according to any one of claims 1 to 4.
10. A computer-readable storage medium, on which an information transfer implementing program is stored, which, when executed by a processor, implements the steps of the method for optimizing an internet riot video recognition model according to any one of claims 1 to 4.
CN201910725251.9A 2019-08-07 2019-08-07 Optimization method and device of internet riot and terrorist video identification model Pending CN110659561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910725251.9A CN110659561A (en) 2019-08-07 2019-08-07 Optimization method and device of internet riot and terrorist video identification model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910725251.9A CN110659561A (en) 2019-08-07 2019-08-07 Optimization method and device of internet riot and terrorist video identification model

Publications (1)

Publication Number Publication Date
CN110659561A true CN110659561A (en) 2020-01-07

Family

ID=69036438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910725251.9A Pending CN110659561A (en) 2019-08-07 2019-08-07 Optimization method and device of internet riot and terrorist video identification model

Country Status (1)

Country Link
CN (1) CN110659561A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112906588A (en) * 2021-03-01 2021-06-04 上海交通大学 Riot and terrorist picture safety detection system based on deep learning

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112906588A (en) * 2021-03-01 2021-06-04 上海交通大学 Riot and terrorist picture safety detection system based on deep learning

Similar Documents

Publication Publication Date Title
CN111950723B (en) Neural network model training method, image processing method, device and terminal equipment
CN112950581B (en) Quality evaluation method and device and electronic equipment
CN109344884B (en) Media information classification method, method and device for training picture classification model
WO2023050650A1 (en) Animation video generation method and apparatus, and device and storage medium
CN108509827B (en) Method for identifying abnormal content in video stream and video stream processing system and method
CN110956037B (en) Multimedia content repeated judgment method and device
CN113128287B (en) Method and system for training cross-domain facial expression recognition model and facial expression recognition
CN111126347B (en) Human eye state identification method, device, terminal and readable storage medium
WO2018120723A1 (en) Video compressive sensing reconstruction method and system, and electronic apparatus and storage medium
JP2022547248A (en) Scalable architecture for automatic generation of content delivery images
CN111047543A (en) Image enhancement method, device and storage medium
CN112995690B (en) Live content category identification method, device, electronic equipment and readable storage medium
CN113762107A (en) Object state evaluation method and device, electronic equipment and readable storage medium
CN113962965A (en) Image quality evaluation method, device, equipment and storage medium
CN112712068A (en) Key point detection method and device, electronic equipment and storage medium
CN106250871A (en) City management case classification method and device
CN110659561A (en) Optimization method and device of internet riot and terrorist video identification model
CN111652238B (en) Multi-model integration method and system
CN111612732A (en) Image quality evaluation method, image quality evaluation device, computer equipment and storage medium
CN115620074A (en) Image data classification method, device and medium
CN112541469B (en) Crowd counting method and system based on self-adaptive classification
CN113688989A (en) Deep learning network acceleration method, device, equipment and storage medium
CN112347990A (en) Multimode-based intelligent manuscript examining system and method
CN113240032A (en) Image classification method, device, equipment and storage medium
CN110647933B (en) Video classification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200107

RJ01 Rejection of invention patent application after publication