A method for automatically cropping audio-visual datasets containing anchors in Cantonese news videos
Through the automatic cropping method based on HSV image information and face recognition technology, the problem of low quality of Cantonese audio-visual data sets is solved, the efficiency of data set construction is improved, and it can be extended to other language environments and is suitable for various audio and video model training.
Patent Information
- Application Number
- CN202211132338.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-17
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-09-17
AI Technical Summary
There is a lack of high-quality Cantonese audio-visual data sets in the existing technology, resulting in low efficiency and high cost of data set construction, especially in non-English language environments.
The detection algorithm and face recognition technology based on HSV image information are used to automatically crop the anchor report video in the Cantonese news video. Through video scene segmentation, target face classification and speech post-processing, a high-quality audio-visual data set is generated.
It improves the construction efficiency of audio-visual multi-modal data sets, and the generated data sets are of high quality, which can be effectively used in model training such as speech denoising and speech separation, and can be extended to the construction of other language data sets.
Smart Images

Figure CN115460462B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for automatically cutting an audio-visual data set containing an anchor in a Cantonese news video, and belongs to the technical fields of artificial intelligence, deep learning, and digital image processing. Background Art
[0002] Most of the currently used audio-visual datasets are built in English scenarios, such as the LRS dataset, the GRID dataset, the VoxCeleb dataset, etc. Although these datasets contain a large amount of data, the quality of the face videos they contain is not very high, and there are problems such as not including the frontal face of the characters and high audio noise.
[0003] For a non-English language, producing a high-quality audio-visual dataset requires a lot of manpower costs. Professionals need to be arranged to record speaking videos of a certain length in a specified environment, and the quality of the video needs to be guaranteed.
[0004] In summary, for the production of the Cantonese audio-visual multimodal dataset, choosing to use the TV station's news broadcast as the data source can ensure the professionalism of the video recording, the breadth of the fields involved, and the accessibility of the program data, so as to obtain high-quality data. And building a method for automatically cropping the anchor's face based on this data can save a lot of labor costs. Summary of the invention
[0005] The purpose of the present invention is to provide a method for automatically cropping an audio-visual data set containing a host in a Cantonese news video, so as to solve the problem that there is no high-quality Cantonese audio-visual data set in the existing scenario introduced in the background technology. The method can use the public high-quality Cantonese news broadcast video to automatically crop the audio-visual data set of the host reporting the news, which can greatly improve the efficiency of constructing an audio-visual multimodal data set.
[0006] The present invention adopts the following technical solutions to solve the above technical problems:
[0007] The present invention provides a method for automatically cutting an audio-visual data set containing a host in a Cantonese news video, and the specific steps are as follows: Step 1, video scene segmentation,
[0008] 1.1. Collect the Cantonese news broadcast videos released by TV stations. The news anchors in the videos need to broadcast the news in Cantonese;
[0009] 1.2, use a detection algorithm based on HSV image information to process the video in 1.1, and obtain videos of different scenes after cutting according to the changes in scene information.
[0010] Step 2: target face classification.
[0011] 2.1, Face detection tool Face Recognition detects faces in scene videos. Videos that do not contain faces or contain more than one face will be discarded directly;
[0012] 2.2, for a scene video containing only one face, use Face Recognition to calculate the 128-dimensional facial feature vector of the face and the target anchor’s face;
[0013] 2.3, calculate the cosine similarity of the two feature vectors in 2.2. If it is greater than the set threshold, the scene video is considered to be a video clip containing only the target anchor's broadcast, and it is added to the target anchor's folder, otherwise the video is discarded.
[0014] Step 3, speech post-processing,
[0015] 3.1. For the videos in the target anchor's folder, use the FFmpeg tool to extract the audio corresponding to the video;
[0016] 3.2. Using the Voice Activity Detection (VAD) method, the pauses in the speech are detected and segmented, and the segmented pause point information is obtained to form audio modality data;
[0017] 3.3, using the segmented pause point information to segment the corresponding video, obtain the video segment corresponding to the audio segment, and form video modality data.
[0018] As a further optimization scheme of the present invention, a detection algorithm based on HSV image information selected in step 1 can compare the change in HSV information between two adjacent frames of images. If the change exceeds a set threshold, it can be considered that a scene change occurs in the video here.
[0019] A frame of image in a video is three-channel RGB data, which is first converted into three-channel HSV data. The conversion method is shown in formulas (1)-(3):
[0020] V=max(R,G,B) (1)
[0021]
[0022]
[0023] Among them, R, G, and B are the values of the red, green, and blue channels of each pixel. If the calculated H value is less than 0, then H = H + 360. In order to facilitate the calculation of subsequent video frame features, the obtained HSV needs to be appropriately scaled, specifically, the saturation S and brightness V are enlarged by 255 times, and the hue is reduced to half of the original. The data in the HSV format is also a kind of data containing three channels.
[0024] After obtaining the HSV format data of two adjacent video frames, the average difference of the HSV data of each pixel and each channel of the two adjacent images is calculated. If this difference is greater than the set threshold, it means that the scene has changed significantly, that is, the scene has switched. The specific method for calculating the difference is shown in formula (4).
[0025]
[0026] where F last and F current Indicates the pixel values in HSV format between the previous frame and the current frame. m, n indicate the height and width of the video frame, i indicates that the data of the i-th channel is currently being calculated, and score indicates the difference score between the two frames. The higher the score, the greater the difference between them, and the more likely it is to be used as a scene switching point.
[0027] After experimental testing, the scene segmentation results are better when the threshold is set to 27. In the end, a 30-minute news broadcast video will be segmented into about 300 small video clips on average.
[0028] As a further optimization scheme of the present invention, in step 2, when calculating the similarity of the 128-dimensional facial feature vectors of the person in the video and the target person, after experimental testing, when the threshold of the cosine similarity is set at 0.92, a better face recognition effect can be achieved.
[0029] As a further optimization scheme of the present invention, the length of each speech finally obtained in the step 3 is maintained at about 5s to 10s, which can ensure the uniform distribution of data duration and can be effectively used in the training of the model later.
[0030] As a further optimization scheme of the present invention, the method finally obtains a one-to-one corresponding speech .wav format audio file and .mp4 video file.
[0031] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0032] ① High quality of data set: The present invention can obtain audio and video data sets using a large number of high-quality and publicly available news broadcast videos;
[0033] ②Automatic video scene cropping: For massive videos, the present invention can automatically crop the part of the video where the host speaks based on the changes in the HSV information in the video, and obtain the video of the person speaking and the corresponding audio;
[0034] ③Automated host video recognition: The present invention can use face recognition technology to effectively identify videos that only contain the target host's face in the segmented scene, while filtering out clips with multiple hosts or without the host.
[0035] ④ Obtaining a data set is easy for related model training: The present invention can segment the speaking video based on the speaker's pauses, so that the final audio and video length is about 5s-10s, which can facilitate the training of models related to audio and video;
[0036] ⑤Easy to extend to the construction of datasets in other languages: The technology in the present invention can be easily extended to the construction of datasets in other languages. It only needs to replace the data source with the language video in the video acquisition stage and update the face photos in the video character library to automatically complete the construction of the audio-visual dataset.
[0037] ⑥ The obtained data set has strong applicability: the data set obtained by the present invention can be applied to audio-related model training, such as speech denoising, speech separation, etc., and can also be combined with video for models such as lip synchronization, audio and video driven speaking face generation, etc.
[0038] In general, the present invention solves the problem of the lack of high-quality Cantonese audio-visual datasets in the existing scenarios introduced in the background technology. The method can use the public high-quality Cantonese news broadcast video to automatically crop the audio-visual dataset of the anchor reporting the news, which can greatly improve the efficiency of constructing audio-visual multimodal datasets. At the same time, it can be effectively extended to the production of audio-visual datasets in other languages, solving the problem of the current lack of Chinese dialect audio-visual datasets, so as to be efficiently applied to the training of models such as speech denoising, speech synthesis, and audio-video driven face video synthesis. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a method for automatically cropping an audio-visual dataset containing an anchor in a Cantonese news video;
[0040] Figure 2 The following are examples of videos of the three types of scenes after segmentation, where (a) is a scene video of two news anchors reporting news at the same time, (b) is a scene video of no news anchor reporting news, and (c) is a scene video of a news anchor reporting news;
[0041] Figure 3A flowchart for target face classification of a news anchor in a scene video containing only one news anchor reporting news. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention and to make the above-mentioned purposes, features and advantages of the embodiments of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0043] Example 1: See Figure 1 — Figure 3 , a method for automatically cropping an audio-visual dataset containing anchors in a Cantonese news video, the specific steps are as follows:
[0044] Step 1: Video scene segmentation.
[0045] 1.1. Collect the Cantonese news broadcast videos released by TV stations. The news anchors in the videos need to broadcast the news in Cantonese;
[0046] 1.2, use a detection algorithm based on HSV image information to process the video in 1.1, and obtain videos of different scenes after cutting according to the changes in scene information.
[0047] Step 2: target face classification.
[0048] 2.1, Face detection tool Face Recognition detects faces in scene videos. Videos that do not contain faces or contain more than one face will be discarded directly;
[0049] 2.2, for a scene video containing only one face, use Face Recognition to calculate the 128-dimensional facial feature vector of the face and the target anchor’s face;
[0050] 2.3, calculate the cosine similarity of the two feature vectors in 2.2. If it is greater than the set threshold, the scene video is considered to be a video clip containing only the target anchor's broadcast, and it is added to the target anchor's folder, otherwise the video is discarded;
[0051] Step 3, speech post-processing,
[0052] 3.1. For the videos in the target anchor's folder, use the FFmpeg tool to extract the audio corresponding to the video;
[0053] 3.2. Using the Voice Activity Detection (VAD) method, the pauses in the speech are detected and segmented, and the segmented pause point information is obtained to form audio modality data;
[0054] 3.3, using the segmented pause point information to segment the corresponding video, obtain the video segment corresponding to the audio segment, and form video modality data.
[0055] The detection algorithm based on HSV image information selected in step 1 can compare the change of HSV information between two adjacent frames of images. If the change exceeds the set threshold, it can be considered that the video has a scene change here. A frame of image in the video is three-channel RGB data. First, it is converted into three-channel HSV data, and then the average difference of HSV data of each pixel in each channel is calculated. If this difference is greater than the set threshold, it means that the scene has changed greatly, that is, the scene has switched here. After experimental testing, the scene segmentation result is better when the threshold is set to 27. In step 2, when calculating the similarity of the 128-dimensional facial feature vectors of the person in the video and the target person, after experimental testing, when the threshold of cosine similarity is set to 0.92, a better face recognition effect can be achieved. The length of each voice finally obtained in step 3 is kept at about 5s to 10s, which can ensure the uniform distribution of data duration and be effectively used in model training later. The method finally obtains a one-to-one corresponding voice.wav format audio file and.mp4 video file.
[0056] A schematic diagram of a method for automatically cropping multimodal data in a sign language video proposed by the present invention is shown in FIG. Figure 1 As shown in the figure. The figure mainly consists of three parts: video scene segmentation, target face classification, and speech post-processing. The first part first performs scene segmentation on the collected Cantonese news videos to obtain multiple scene videos after segmentation. The second part is to perform face detection on the scene video. If it does not contain a face or contains more than one face, it will be discarded. Otherwise, the feature vector will be extracted and compared with the current target anchor face. If the similarity is greater than the set threshold, the scene video will be placed in the folder corresponding to the target anchor, otherwise the video will be discarded. The third part is to perform some post-processing on the video in the target anchor folder, including extracting audio, segmenting the audio according to the pauses in the audio, and segmenting the video according to the recorded segmentation points, to obtain the final video and audio clips of about 5 to 10 seconds containing the target anchor reporting the news.
[0057] Example 2: See Figure 1 — Figure 3 ,: For the video source - Guangdong Zhujiang TV Station's "Today's Focus" column, a video from January 2022 is selected to explain the steps of the present invention in detail,
[0058] Experimental environment: a server with four NVIDIA GeForce GTX 1080Ti GPUs, Ubuntu 16.04 operating system, and Python 3.8 software environment.
[0059] Experimental steps:
[0060] ① Video scene segmentation: For the original video, the detection algorithm based on HSV image information can compare the change in HSV information between two adjacent frames. By comparing the HSV information of each frame, the change in video content is calculated, so as to detect the frames that switch quickly between video scenes. Cutting at this frame can obtain videos of different scenes after cutting. Figure 2 The following are three types of segmented videos. 2(a) is a video of two anchors simultaneously reporting news that needs to be discarded. 2(b) is a video of a scene without a news anchor that needs to be discarded. 2(c) is a video of whether the target anchor is reporting news that we need to determine.
[0061] ② Target face classification: In the segmented scene video, use the face detection tool Face Recognition to detect whether there is only one face object in the video. If so, extract its face feature vector and calculate the cosine similarity with the target anchor’s face feature vector. If it is greater than the set threshold, the scene video is considered to be a video clip containing only the target anchor’s broadcast, and it is added to the target anchor’s folder. Otherwise, it will continue to be retained and the same judgment will be made with the next target anchor’s picture. Figure 3 The figure shows the target face classification process. The input target anchor face and the face extracted from the processed scene video are used to extract a 128-dimensional face feature vector. and And calculate the cosine similarity sim of the two. If sim is greater than the set threshold of 0.92, the scene video is added to the target anchor's folder;
[0062] ③ Voice post-processing: For the videos in the target anchor's folder, use the FFmpeg tool to extract the corresponding audio. Cut the obtained audio according to the pauses, and record the start frame and end frame of the cut, and then use it as a basis to cut the corresponding video, and finally obtain the corresponding voice .wav format audio clips and .mp4 video file clips.
[0063] The above is a preferred implementation mode of the present experiment. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that it is still possible to modify the technical solutions described in the aforementioned embodiments, or to make equivalent replacements for some of the technical features therein; and these modifications or replacements should also be regarded as the scope of protection of the present invention.
Claims
1. A method for automatically cutting out an audio-visual data set containing a host in a Cantonese news video, characterized in that the specific steps are as follows: Step 1: Video scene segmentation. 1.
1. Collect the Cantonese news broadcast videos released by TV stations. The news anchors in the videos need to broadcast the news in Cantonese; 1.2, using a detection algorithm based on HSV image information to process the video in 1.1, and obtaining videos of different scenes after cutting according to the changes in scene information; Step 2: target face classification. 2.1, Face detection tool Face Recognition detects faces in scene videos. Videos that do not contain faces or contain more than one face will be discarded directly; 2.2, for a scene video containing only one face, use Face Recognition to calculate the 128-dimensional facial feature vector of the face and the target anchor’s face; 2.3, calculate the cosine similarity of the two feature vectors in 2.
2. If it is greater than the set threshold, the scene video is considered to be a video clip containing only the target anchor's broadcast, and it is added to the target anchor's folder, otherwise the video is discarded; Step 3, speech post-processing, 3.
1. For the videos in the target anchor's folder, use the FFmpeg tool to extract the audio corresponding to the video; 3.
2. Using the Voice Activity Detection (VAD) method, the pauses in the speech are detected and segmented, and the segmented pause point information is obtained. This step forms the data of the audio mode. 3.3, using the segmented pause point information to segment the corresponding video, to obtain the video segment corresponding to the audio segment, this step forms the data of the video modality; The detection algorithm based on HSV image information selected in step 1 can compare the change amount of HSV information between two adjacent frames of images. If the change amount exceeds a set threshold, it is considered that a scene change occurs in the video at this point. A frame of image in a video is three-channel RGB data, which is first converted into three-channel HSV data. The conversion method is shown in formulas (1)-(3): V=max(R,G,B)(1) Among them, R, G, and B are the values of the red, green, and blue channels of each pixel respectively. If the calculated H value is less than 0, then H = H + 360. The saturation S and brightness V are enlarged by 255 times, and the hue is reduced to half of the original. The final data in HSV format is also a data containing three channels. After obtaining the HSV format data of two adjacent video frames, the average difference of the HSV data of each pixel and each channel of the two adjacent images is calculated. If this difference is greater than the set threshold, it means that the scene has changed significantly, that is, the scene has switched. The specific method of calculating the difference is shown in formula (4): where F last and F current Indicates the HSV format pixel values of the previous frame and the current frame, m and n indicate the height and width of the video frame, i indicates that the data of the i-th channel is currently being calculated, and score indicates the difference score between the two frames. The higher the score, the greater the difference between them, and the more likely it is to be used as a scene switching point. Set the threshold at 27.
2. The method for automatically cropping an audio-visual data set containing an anchor in a Cantonese news video as described in claim 1, characterized in that in step 2, when calculating the similarity of the 128-dimensional facial feature vectors of the person in the video and the target person, the threshold of the cosine similarity is set to 0.
92.
3. The method for automatically cutting out the audio-visual data set containing the anchor in a Cantonese news video as claimed in claim 1, characterized in that: The length of each speech finally obtained in step 3 is maintained at 5s to 10s.
4. The method for automatically cutting out the audio-visual data set containing the anchor in a Cantonese news video as claimed in claim 1, characterized in that: Finally, we get the corresponding .wav audio files and .mp4 video files.
