A video partition layout analysis method and device
Through the video partition layout analysis method, the target detection model is used to identify and segment video frame images, which solves the problem of video frame partition and layout change detection in remote video calls in the financial industry, realizing intelligent quality inspection and auditing, and adapting to multiple characters. and document certificate partitioning, which improves the efficiency of quality inspection.
Patent Information
- Application Number
- CN202410764034.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-14
AI Technical Summary
The financial industry needs to automatically realize partitioning and layout change detection of video frame images during remote video calls. It is difficult to achieve intelligent quality inspection and audit with existing technology.
The video partition layout analysis method is adopted, including the model training and model inference stages. The target detection model is used to identify people and document ID partitions, and video segmentation is performed through similarity calculation to achieve intelligent partition marking and layout analysis of each frame of image.
It realizes intelligent segmentation of videos and partition marking of each frame of image, improves the quality inspection efficiency of video recordings in the financial industry, adapts to the partitioning conditions of multiple people and documents, and has fast segmentation speed.
Smart Images

Figure CN118334562B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video partition layout analysis, and in particular to a video partition layout analysis method and device. Background Art
[0002] Today, the financial industry (banks, insurance companies, securities companies) is facing the transformation of online processing, younger customer groups, and intelligent customer experience. In order to better cater to the changes in user needs and meet customers' urgent needs for remote business handling, many financial-related companies have launched remote business handling services, "moving" traditional offline business online. Staff and customers conduct business by establishing remote video calls, recreating a new model for financial business handling.
[0003] In order to facilitate customer operations, the mini-programs or apps for online business processing will flexibly arrange the layout of the staff, customers, and sales document display windows. In order to protect the legal rights of customers, the business processing process needs to be recorded as a video and saved, and these videos need to be analyzed. This brings new challenges to the use of AI algorithms for quality inspection and auditing of such video materials, namely how to automatically partition each frame of the video and detect the time point when the partition layout changes. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a video partition layout analysis method and device. The following technical solutions are adopted:
[0005] A video partition layout analysis method includes a model training phase and a model reasoning phase;
[0006] The model training phase includes the following steps:
[0007] Step 11, obtaining materials required for sample generation;
[0008] Step 12, generating training samples using the material obtained in step 11, and obtaining the circumscribed rectangle coordinates of the person partition and the document display partition;
[0009] Step 13, training a partitioned object detection model;
[0010] The model inference phase includes the following steps:
[0011] Step 21, obtain the video to be detected, extract frames of the video to be detected, extract one frame every step seconds, and record the frame number of each extracted frame image;
[0012] Step 22, performing partition detection on each frame of the image obtained in step 21 to obtain a person partition and a document display partition of each frame of the image;
[0013] Step 23, segment the video, and the video frames in each segment have the same partition layout.
[0014] By adopting the above technical solution, the video to be detected can be intelligently segmented, and the video frames in each segment have the same partition layout; each frame of the video is partitioned, and each partition is intelligently marked as a person partition and a document display partition; and intelligent quality inspection and auditing of video materials in the financial industry can be realized.
[0015] Optionally, in step 11, the material includes facial images under various backgrounds, and includes images of different documents and certificates.
[0016] Step 12 contains the following sub-steps:
[0017] Step 121, randomly selecting one layout from multiple layout examples;
[0018] Step 122, randomly selecting 1-3 partitions in the layout selected in step 121, replacing pixels in the selected partitions with face images under different backgrounds as person partitions, and recording the circumscribed rectangle coordinates of the person partitions;
[0019] Step 123, replacing the pixels in the remaining partitions with images of documents and certificates as the document and certificate display partitions, and recording the coordinates of the circumscribed rectangle of the document and certificate display partitions;
[0020] Step 124: Repeat steps 121, 122, and 123 until sufficient training samples are generated.
[0021] Specifically, face images under various backgrounds can be downloaded from the Internet, images of different documents and certificates can be downloaded from the Internet, samples can be synthesized according to the layout examples, and the circumscribed rectangle coordinates of the person partition and the document and certificate display partition can be obtained at the same time.
[0022] Optionally, step 12 may be replaced by obtaining an image from a real video of a production environment, and manually marking the bounding rectangles of the person partition and the document display partition in the image.
[0023] Optionally, the target detection model in step 13 may be any target detection model, including but not limited to a yolov3 model or an SSD model.
[0024] Optionally, step 22 includes the following sub-steps:
[0025] Step 221, using the partition target detection model obtained in step 13 to perform partition detection on each frame image obtained in step 21, to obtain the number of human partitions and the coordinate positions of the circumscribed rectangles of the human partitions and the number of document and certificate display partitions and the coordinate positions of the circumscribed rectangles of the document and certificate display partitions;
[0026] Step 222: If the sum of the number of person zones and the number of document and certificate display zones obtained in step 221 is greater than or equal to 2, then record the person zones and the document and certificate display zones;
[0027] Step 223, if only one person partition is detected in step 221 and there is no document display partition, calculate the ratio of the number of pixels contained in the bounding rectangle of the partition to the number of pixels of the frame image, and if the ratio is greater than the threshold thr_rate, mark the entire image as a person partition;
[0028] Step 224, if step 221 only detects one document and certificate display partition and no person partition, calculate the ratio of the number of pixels contained in the circumscribed rectangle of the partition to the number of pixels in the frame image. If the ratio is greater than the threshold thr_rate, mark the entire image as a document and certificate display partition.
[0029] The technical effect of step 22 is: it realizes dividing a single picture into a person partition and a document and certificate display partition, and can adapt to the situation where a picture contains multiple person partitions and multiple document and certificate display partitions, and can also adapt to the special situation where the person partition or the document and certificate display partition fills the entire picture.
[0030] Step 23 includes the following sub-steps:
[0031] Step 231, for the frame-drawing image obtained in step 21, using the partition detection result obtained in step 22, calculate the partition layout similarity of adjacent frame-drawing images one by one, if the similarity is greater than the threshold thr_area, obtain the coarse segmentation result, and record the frame numbers of the corresponding adjacent frame-drawings, denoted as m, n;
[0032] Step 232, obtain all image frames between the mth frame and the nth frame, calculate the similarity of the partition layout of adjacent image frames frame by frame, if the similarity is greater than the threshold thr_area, obtain the refined segmentation result, and record the frame numbers of the corresponding adjacent frames, denoted as k, k+1;
[0033] Step 233, repeating steps 231 and 232, obtaining the refined segmentation results of the partition layout of the video, and recording the precise video frame numbers of all the partition layout changes until the entire video is processed.
[0034] By adopting the above technical solution, all video frame numbers of which the video partition layout has changed are obtained, and the technical solution of first coarse segmentation and then fine segmentation can achieve a faster segmentation speed.
[0035] Optionally, both step 231 and step 232 need to calculate the similarity of the partition layouts of the two frames. The following is a specific method for calculating the similarity of the partition layouts of the sth frame and the tth frame. The partition layout of the tth frame of the video is represented as Among them is is the i-th partition, is the category of the i-th partition, Indicates that the partition is a character partition. Indicates that the partition is a document and certificate display partition. is the number of partitions, Identify the bounding rectangle of the i-th partition; similarly, the partition layout of the s-th frame of the video can be represented in the same way. The calculation method of the partition layout similarity (s, t) between the s-th frame and the t-th frame is:
[0036] Not equal to
[0037] Similarity(s,t) = 0
[0038] else
[0039] sum = 0
[0040]
[0041] max_score = 0
[0042] max_index = 0
[0043]
[0044]
[0045] is the partition similarity between the uth partition of the sth frame and the vth partition of the tth frame. It is necessary to ensure that if the partition types are different, the partition similarity is 0.
[0046]
[0047] max_score = temp
[0048] max_index = v
[0049] sum = sum + max_score
[0050] .
[0051] The specific method for calculating the partition layout similarity between the sth frame and the tth frame can be described as follows: if the number of partitions of the two frames is different, the partition layout similarity is zero; if the number of partitions of the two frames is the same, then for each partition of the sth frame , search for the same The most similar partitions are selected and the corresponding maximum partition similarities are obtained; the average value of all maximum partition similarities is taken as the partition layout similarity between the s-th frame and the t-th frame.
[0052] A video partition layout analysis device includes a computer-readable storage medium and a processor. The computer-readable storage medium stores a video partition layout analysis program designed using a video partition layout analysis method. The processor is communicatively connected to the computer-readable storage medium, runs the video partition layout analysis program to perform video partition layout analysis on a video to be detected, and outputs a refined segmentation result.
[0053] Optionally, a display is also included, which is communicatively connected to the processor and is used to display the video partition layout analysis results.
[0054] Optionally, the video partition layout analysis results include person partitions and document and certificate display partitions, and the video layout segmentation is achieved through coarse segmentation and fine segmentation results, and each segment has the same partition layout.
[0055] By adopting the above technical solution, the specific operation process of the video partition layout analysis device is: obtaining the video to be detected, extracting frames of the video, extracting one frame per step second, and recording the frame number of each extracted frame image;
[0056] Perform partition detection on the sampled frame images to obtain the person partition and document display partition of each frame image.
[0057] The video is segmented, and the video frames in each segment have the same partition layout. First, the partition layout similarity of adjacent frame images is calculated one by one to obtain the coarse segmentation result; secondly, the partition layout similarity of adjacent frames is calculated one by one to obtain the final fine segmentation result.
[0058] The above-mentioned video partition layout device obtains accurate person partitions and document display partitions by performing partition target detection on each image in the video frame image sequence, and then realizes video layout segmentation through coarse segmentation and fine segmentation, and each segment has the same partition layout.
[0059] In summary, the present invention includes at least the following beneficial technical effects:
[0060] The present invention can provide a video partition layout analysis method and device, which has two functions:
[0061] 1) Segment the video so that the video frames in each segment have the same partition layout;
[0062] 2) Partition each frame of the video and mark each partition as a person partition and a document display partition.
[0063] Intelligently mark each partition as a person partition and a document and certificate display partition; realize intelligent quality inspection and audit of video materials in the financial industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a flow chart of a video partition layout analysis method of the present invention;
[0065] Figure 2 It is a layout diagram of a specific embodiment of a video partition layout analysis method of the present invention;
[0066] Figure 3 It is a layout diagram of a specific embodiment of a video partition layout analysis method of the present invention. DETAILED DESCRIPTION
[0067] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0068] The embodiment of the invention discloses a video partition layout analysis method and device.
[0069] Reference Figure 1-Figure 3 ,A video partition layout analysis method includes a model training phase and a model reasoning phase;
[0070] The model training phase includes the following steps:
[0071] Step 11, obtaining materials required for sample generation;
[0072] Step 12, generating training samples using the material obtained in step 11, and obtaining the circumscribed rectangle coordinates of the person partition and the document display partition;
[0073] Step 13, training a partitioned object detection model;
[0074] The model inference phase includes the following steps:
[0075] Step 21, obtain the video to be detected, extract frames of the video to be detected, extract one frame every step seconds, and record the frame number of each extracted frame image;
[0076] Step 22, performing partition detection on each frame of the image obtained in step 21 to obtain a person partition and a document display partition of each frame of the image;
[0077] Step 23, segment the video, and the video frames in each segment have the same partition layout.
[0078] By adopting the above technical solution, the video to be detected can be intelligently segmented, and the video frames in each segment have the same partition layout; each frame of the video is partitioned, and each partition is intelligently marked as a person partition and a document display partition; and intelligent quality inspection and auditing of video materials in the financial industry can be realized.
[0079] In step 11, the material includes facial images under various backgrounds, and images of different documents and certificates.
[0080] Step 12 contains the following sub-steps:
[0081] Step 121, from Figure 2 , Figure 3 One layout is randomly selected from the layout examples shown;
[0082] Step 122, randomly selecting 1-3 partitions in the layout selected in step 121, replacing pixels in the selected partitions with face images under different backgrounds as person partitions, and recording the circumscribed rectangle coordinates of the person partitions;
[0083] Step 123, replacing the pixels in the remaining partitions with images of documents and certificates as the document and certificate display partitions, and recording the coordinates of the circumscribed rectangle of the document and certificate display partitions;
[0084] Step 124: Repeat steps 121, 122, and 123 until sufficient training samples are generated.
[0085] Specifically, face images under various backgrounds can be downloaded from the Internet, images of different documents and certificates can be downloaded from the Internet, samples can be synthesized according to the layout examples, and the circumscribed rectangle coordinates of the person partition and the document and certificate display partition can be obtained at the same time.
[0086] Optionally, in step 12, an image may be obtained from a real video of a production environment, and the bounding rectangles of the person partition and the document display partition in the image may be manually marked.
[0087] The target detection model in step 13 may be any target detection model, including but not limited to a yolov3 model or an SSD model.
[0088] The training partition target detection model is not limited to the target detection algorithm used. For example, in one embodiment, the yolov3 model can be used, and in another embodiment, the SSD model can be used.
[0089] Step 22 includes the following sub-steps:
[0090] Step 221, using the partition target detection model obtained in step 13 to perform partition detection on each frame image obtained in step 21, to obtain the number of person partitions, the coordinate positions of the circumscribed rectangles of the person partitions, the number of document and certificate display partitions, and the coordinate positions of the circumscribed rectangles of the document and certificate display partitions;
[0091] Step 222: If the sum of the number of person zones and the number of document and certificate display zones obtained in step 221 is greater than or equal to 2, then record the person zones and the document and certificate display zones;
[0092] Step 223, if only one person partition is detected in step 221 and there is no document display partition, calculate the ratio of the number of pixels contained in the bounding rectangle of the partition to the number of pixels of the frame image, and if the ratio is greater than the threshold thr_rate, mark the entire image as a person partition;
[0093] Step 224, if step 221 only detects one document and certificate display partition and no person partition, calculate the ratio of the number of pixels contained in the circumscribed rectangle of the partition to the number of pixels in the frame image. If the ratio is greater than the threshold thr_rate, mark the entire image as a document and certificate display partition.
[0094] It is possible to divide a single image into a person partition and a document and ID display partition, and can adapt to special situations where the person detection partition or the document and ID detection partition fills the entire image.
[0095] Step 23 includes the following sub-steps:
[0096] Step 231, for the frame-drawing image obtained in step 21, using the partition detection result obtained in step 22, calculate the partition layout similarity of adjacent frame-drawing images one by one, if the similarity is greater than the threshold thr_area, obtain the coarse segmentation result, and record the frame numbers of the corresponding adjacent frame-drawings, denoted as m, n;
[0097] Step 232, obtain all image frames between the mth frame and the nth frame, perform partition target detection frame by frame, calculate the partition layout similarity of adjacent image frames frame by frame, if the similarity is greater than the threshold thr_area, obtain the refined segmentation result, and record the frame numbers of the corresponding adjacent frames, denoted as k, k+1;
[0098] Step 233, repeating steps 231 and 232, obtaining the refined segmentation results of the partition layout of the video, and recording the precise video frame numbers of all the partition layout changes until the entire video is processed.
[0099] Gets all the video frame numbers where the video partition layout changes.
[0100] In both step 231 and step 232, the similarity of the partition layouts of the two frames of images needs to be calculated. The following is a specific method for calculating the similarity of the partition layouts of the sth frame and the tth frame. The partition layout of the tth frame of the video is represented as Among them is is the i-th partition, is the category of the i-th partition, Indicates that the partition is a character partition. Indicates that the partition is a document and certificate display partition. is the number of partitions, Identify the bounding rectangle of the i-th partition; similarly, the partition layout of the s-th frame of the video can be represented in the same way. The calculation method of the partition layout similarity (s, t) between the s-th frame and the t-th frame is:
[0101] Not equal to
[0102] Similarity(s,t) = 0
[0103] else
[0104] sum = 0
[0105]
[0106] max_score = 0
[0107] max_index = 0
[0108]
[0109]
[0110] is the partition similarity between the uth partition of the sth frame and the vth partition of the tth frame. It is necessary to ensure that if the partition types are different, the partition similarity is 0.
[0111]
[0112] max_score = temp
[0113] max_index = v
[0114] sum = sum + max_score
[0115] .
[0116] The specific method for calculating the partition layout similarity between the sth frame and the tth frame can be described as follows: if the number of partitions of the two frames is different, the partition similarity is zero; if the number of partitions of the two frames is the same, then for each partition of the sth frame , find and The partition of the t-th frame that is most similar is obtained and the corresponding maximum partition similarity is obtained; the average value of all maximum partition similarities is taken as the partition layout similarity between the s-th frame and the t-th frame.
[0117] In a specific embodiment, video partition layout analysis of the video of the remote synchronous audio and video recording of the insurance sales behavior is a typical application scenario for the remote development of the agency sales business.
[0118] In another specific embodiment, the self-service dual-recording video is analyzed for partition layout. In this scenario, in addition to the customer, a digital person may also appear.
[0119] In one embodiment, the video that needs to be analyzed for video partition layout is vertical. This scenario is often seen in videos recorded by mobile APP, mini program or H5. The following are some examples of partition layout in this scenario. Figure 2 ;
[0120] In another embodiment, the video that needs to be analyzed for video partition layout is horizontal. This scenario is often seen in videos recorded by the seat end. The following are some examples of partition layout in this scenario. Figure 3 ;
[0121] In one embodiment, a video partition layout detection training set is obtained by relying on real production videos. Specifically, a frame of image is extracted from the production video every 5 seconds, and then the partition detection result of each image is obtained by manual annotation.
[0122] In another embodiment, a video partition layout detection training set is obtained by using a sample generation technology. Specifically, face images with different backgrounds are downloaded from the Internet, and images of different documents and certificates are downloaded from the Internet. Figure 2 and Figure 3 The layout example shown is a synthetic sample, and the coordinates of the bounding rectangles of the person partition and the document display partition are obtained at the same time.
[0123] The "training partition target detection model" is not limited to the target detection algorithm used. For example, in one embodiment, the yolov3 model can be used, and in another embodiment, the SSD model can be used.
[0124] In one embodiment, the partition similarity between the uth partition of the sth frame and the vth partition of the tth frame is The calculation method is:
[0125]
[0126] #If the partition types are different, the partition similarity is 0
[0127] else
[0128]
[0129] is a measure of the degree of overlap between two bounding boxes or regions, calculated by dividing the area of their intersection by the area of their union. If two bounding boxes or regions completely overlap, then is 1; if there is no overlap at all, is 0.
[0130] In another embodiment, the partition similarity between the uth partition of the sth frame and the vth partition of the tth frame is The calculation method is:
[0131]
[0132]
[0133] ilse
[0134] image_u is the sth frame Sub-image in
[0135] fea_u=image_u's histogram in the three channels of R, G, and B is a 256*3=768-dimensional vector.
[0136] image_v is the tth frame Sub-image in
[0137] fea_v = histogram of image_v in R, G, B channels, which is a 256*3=768-dimensional vector
[0138] and The cosine distance.
[0139] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video partition layout analysis method, characterized in that: Includes model training phase and model inference phase; The model training phase includes the following steps: Step 11, obtaining materials required for sample generation; Step 12, generating training samples using the material obtained in step 11, and obtaining the circumscribed rectangle coordinates of the person partition and the document display partition; Step 13, training a partitioned object detection model; The model inference phase includes the following steps: Step 21, obtain the video to be detected, extract frames of the video to be detected, extract one frame every step seconds, and record the frame number of each extracted frame image; Step 22, performing partition detection on each frame of the image obtained in step 21 to obtain a person partition and a document display partition of each frame of the image; Step 23, segmenting the video, wherein the video frames in each segment have the same partition layout; Step 22 includes the following sub-steps: Step 221, using the partition target detection model obtained in step 13 to perform partition detection on each frame image obtained in step 21, to obtain a person partition and a document display partition; Step 222, if the sum of the number of person zones and the number of document and certificate display zones obtained in step 221 is greater than or equal to 2, then record the person zone and the document and certificate display zone; Step 223, if only one person partition is detected in step 221 and there is no document display partition, calculate the ratio of the number of pixels contained in the bounding rectangle of the partition to the number of pixels of the frame image, and if the ratio is greater than the threshold thr_rate, mark the entire image as a person partition; Step 224, if only one document and certificate display partition is detected in step 221 and no person partition is detected, the ratio of the number of pixels contained in the bounding rectangle of the partition to the number of pixels of the frame image is calculated. If the ratio is greater than the threshold thr_rate, the entire image is marked as a document and certificate display partition. Step 23 includes the following sub-steps: Step 231, for the frame-drawing image obtained in step 21, using the partition detection result obtained in step 22, calculate the partition layout similarity of adjacent frame-drawing images one by one, if the similarity is greater than the threshold thr_area, obtain the coarse segmentation result, and record the frame numbers of the corresponding adjacent frame-drawings, denoted as m, n; Step 232, obtaining all image frames between the mth frame and the nth frame, calculating the similarity of the partition layouts of adjacent image frames frame by frame, and if the similarity is greater than a threshold thr_area, obtaining a refined segmentation result, and recording the frame numbers of the corresponding adjacent frames; Step 233, repeating steps 231 and 232 to obtain the precise segmentation result of the partition layout of the video, and recording the precise video frame numbers where all partition layouts change, until the entire video is processed; The method for calculating the partition layout similarity in step 231 and step 232 is: assuming that the partition layout of the tth frame of the video is represented as Among them is is the i-th partition, is the category of the i-th partition, Indicates that the partition is a character partition. Indicates that the partition is a document and certificate display partition. is the number of partitions, Represents the bounding rectangle of the i-th partition; the partition layout similarity Similarity(s,t) between the s-th frame and the t-th frame is calculated as: If the number of partitions of the two frames is different, the partition layout similarity is zero; if the number of partitions of the two frames is the same, then for each partition of the sth frame , search for the same The most similar partitions are selected and the corresponding maximum partition similarities are obtained; the average value of all maximum partition similarities is taken as the partition layout similarity between the s-th frame and the t-th frame.
2. A video partition layout analysis method according to claim 1, characterized in that: In step 11, the materials include face images under various backgrounds, different document images, and different certificate images.
3. A video partition layout analysis method according to claim 1, characterized in that: Step 12 contains the following sub-steps: Step 121, randomly selecting one layout from multiple layout examples; Step 122, randomly selecting 1 to 3 partitions in the layout selected in step 121, replacing pixels in the selected partitions with face images under different backgrounds as person partitions, and recording the circumscribed rectangle coordinates of the person partitions; Step 123, replacing the pixels in the remaining partitions with images of documents and certificates as the document and certificate display partitions, and recording the coordinates of the circumscribed rectangle of the document and certificate display partitions; Step 124: Repeat steps 121, 122, and 123 until sufficient training samples are generated.
4. A video partition layout analysis device, characterized in that: The method comprises a computer-readable storage medium and a processor, wherein the computer-readable storage medium stores a video partition layout analysis program designed using the video partition layout analysis method according to any one of claims 1 to 3, and the processor is communicatively connected with the computer-readable storage medium, runs the video partition layout analysis program to perform video partition layout analysis on a video to be detected, and outputs a refined segmentation result.
5. A video partition layout analysis device according to claim 4, characterized in that: The system also includes a display, which is communicatively connected to the processor and is used to display the video partition layout analysis result.
