OCR-based cloud mobile phone text content supervision method, system and system
Technical Field
The invention relates to the technical field of image text content supervision, in particular to a cloud mobile phone text content supervision method and system based on OCR.
Background
With the rapid development and popularization of the 5G communication technology, the cloud mobile phone technology is rapidly developed, the cloud mobile phone is more and more practical, and accordingly, the problem of monitoring the text content of the cloud mobile phone needs to be solved. How to effectively and real-timely supervise the text content of the cloud mobile phone is more important to prevent network violence, obscene information and other bad information from flooding on the network and build a good network environment.
At present, a blank exists in the aspect of text content supervision of a cloud mobile phone. In the aspect of general text content supervision, the following implementation schemes currently exist:
(1) the main defects of the character content supervision realized based on the traditional machine learning method are that the timeliness is poor, and the real-time monitoring on the character content cannot be realized;
(2) the method is mainly used for realizing the character content supervision based on the deep learning method, and the main flow is to detect and identify a single character, so that the situation of large character quantity cannot be dealt with.
The existing text content supervision methods mainly comprise two methods, the first method is realized based on a traditional computer vision method, mainly aims at a scene with small data volume, is suitable for a scene with small word stock volume, and has poor effect when the data volume is large. The second method is realized based on a deep learning method, is based on the detection and identification of a single character, has low detection and identification efficiency, and is not suitable for large-scale text content supervision scenes.
Therefore, the prior art has problems and needs to be further improved.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a cloud mobile phone text content supervision method and system based on OCR.
In order to achieve the purpose, the invention adopts the following specific scheme:
the cloud mobile phone text content supervision method based on the OCR comprises the following steps:
s1, inputting a screen capture picture;
s2, OCR text line detection;
s3, OCR text line recognition;
s4, searching and judging violation information;
s5, the next frame is processed.
Further, step S4 includes determining that violation information exists, and performing warning or alarm processing; and judging that no violation information exists, and directly entering the next frame.
Further, in step S2, the OCR text line detection adopts a DBNet text line detection algorithm, which includes the following steps:
s21, inputting a screen capture picture;
s22, extracting the pyramid characteristics of the picture;
s23, feature map up-sampling and feature fusion;
s24, generating a probability map and a threshold map;
s25, generating a binary image from the probability image and the threshold value image;
and S26, generating a prediction result.
Further, in step S3, the OCR text line recognition adopts the CRNN algorithm, which includes the following steps:
s31, inputting a text line image;
s32, CNN extracting characteristics;
s33, LSTM cascade feature;
s34, outputting the recognition text line.
Further, step S4 adopts the violation information retrieval as a sensitive information comparison process, which includes the following steps: s41, inputting text information;
s42, extracting keyword information;
s43, comparing the keyword information;
s44, outputting whether the sensitive word information is included.
Further, the step S41 of extracting the keyword information and extracting the keyword information by using NLP algorithm includes the following steps:
s421, constructing a sensitive information word bank;
s422, training an NLP keyword extraction model;
s423, processing all text information in the input picture by using the trained keyword extraction model;
s424, judging whether the keywords in the sensitive information word bank appear in the text information, if so, outputting the keywords contained in the text information, and if not, outputting 'None'.
The cloud mobile phone word content monitoring system based on the OCR comprises a text information processing module, a text information comparison module and a sensitive information word bank;
the text information processing module consists of a text line detection module and a text line identification module and has the functions of processing the screen shot picture of the cloud mobile phone and outputting all character information contained in the picture; the text information comparison module is composed of a sensitive information comparison module and has the function of comparing the text information output by the text information processing module with a sensitive information word bank and warning or alarming the condition of the sensitive information.
By adopting the technical scheme of the invention, the invention has the following beneficial effects:
the invention discloses a cloud mobile phone word content supervision method and system based on OCR, comprising a text information processing module, a text information comparison module and a sensitive information word bank; the cloud mobile phone screenshot system can process the cloud mobile phone screenshot data in real time, text line detection, text line recognition and sensitive character information comparison are carried out on the screenshot data through a text line-based detection and recognition algorithm, early warning and warning processing are carried out on illegal character contents in the screenshot data of a cloud mobile phone user, and a good network environment is maintained.
Drawings
FIG. 1 is a diagram of a system architecture composition in accordance with an embodiment of the present invention;
FIG. 2 is a system process flow diagram of an embodiment of the present invention;
FIG. 3 is a flow chart of the present line detection algorithm in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart of a text line recognition algorithm in accordance with an embodiment of the present invention;
FIG. 5 is a flowchart of sensitive information comparison according to an embodiment of the present invention;
fig. 6 is a flowchart of extracting keyword information by NLP algorithm according to the embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the following figures and specific examples.
With reference to fig. 1-6: summary of the method principles/procedures of the present invention
The architecture of the system of the present invention is shown in FIG. 1. The system is composed of a text information processing module, a text information comparison module and a sensitive information word bank. The text information processing module consists of a text line detection module and a text line identification module and has the functions of processing the screen shot pictures of the cloud mobile phone and outputting all character information contained in the pictures. The text information comparison module is composed of a sensitive information comparison module and has the function of comparing the text information output by the text information processing module with a sensitive information word bank and warning or alarming the condition of the sensitive information.
The process flow of the invention is shown in FIG. 2. The process of the invention comprises screen capture data reading, screen capture data text line detection, text line identification, violation information retrieval, violation information warning, alarming and the like.
The cloud mobile phone screen capture picture is firstly detected through text lines, all the text lines in the picture are detected, coordinate information of all the text lines in the picture is obtained, and then all the text line pictures are cut out according to the coordinate information and output to a text recognition module. And the text line recognition module sequentially processes the cut pictures and outputs recognition results to the violation information retrieval module. And the violation information retrieval module compares all recognition results in the cloud mobile phone picture with the sensitive information base, and warns or alarms if the sensitive information exists in the recognition results.
The principle of the OCR text line detection algorithm and the algorithm flow are shown in fig. 3.
The text detection algorithm adopts a DBNet text line detection algorithm, which can quickly and accurately detect the text lines in the image,
the input screen capture picture is firstly adjusted to a specified size through scaling processing and then input to a DBNet model, and the model sequentially extracts 5 layers of feature graphs from the input picture. And secondly, performing feature map fusion processing after upsampling the 5-layer feature map to the same size through upsampling processing, wherein the processing mode is to arrange elements at corresponding positions of the feature map to form a vector to form a new feature map. Then, a probability map and a threshold map are formed from the new feature map. The probability map is formed in such a way that the feature map corresponds to the input image, a region containing text is assigned with a high probability value, and a background region not containing text is assigned with a low probability value. The threshold value map is formed by comparing elements in the probability map with a given threshold value, and assigning 1 to the corresponding position of the new feature map when the elements in the probability map are larger than the given threshold value, otherwise, assigning 0. Finally, the region containing the text in the image is predicted by the probability map and the threshold map.
The principle of the OCR text line recognition algorithm is shown in fig. 4.
The text line recognition algorithm of the present invention employs the CRNN algorithm,
the input of the text line recognition algorithm is the output of the original screen capture image through a text line detection module, and the text line recognition algorithm is obtained by cutting and scaling the original image. The text line image is subjected to feature extraction through a convolutional neural network CNN, the extracted features are a group of two-dimensional vectors, the vector width is the maximum number of characters of a single text line which can be identified by a text line identification algorithm, and the vector height is the code of the text line identification algorithm on the single character. The text line is input to an LSTM module after passing through a feature extraction process, the module is a network formed by two layers of recurrent neurons, and the module is used for corresponding the features extracted by the feature extraction module to the original input text line image and outputting a final recognition result.
The principle of the sensitive information comparison algorithm, the sensitive information comparison process is shown in fig. 5.
After the original input picture is subjected to text line detection processing and text line identification processing, all text information in the original image is obtained, and then a sensitive information comparison process is carried out.
After all the text information in the input picture is obtained, the keyword information contained in the text is extracted. The invention adopts NLP algorithm to extract keyword information, as shown in FIG. 6, the specific flow is as follows:
(1) constructing a sensitive information word stock;
(2) training an NLP keyword extraction model;
(3) processing all text information in the input picture by using the trained keyword extraction model;
(4) and judging whether the keywords in the sensitive information word bank appear in the text information or not, if so, outputting the keywords contained in the text information, and otherwise, outputting 'None'.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.