A data cleaning method and system for power distribution safety supervision operations
By combining the OpenPose-GLCM-hash algorithm with the gray-level co-occurrence matrix and the improved OpenPose algorithm, the shortcomings of traditional image deduplication algorithms in local content recognition are solved, and more efficient and accurate image deduplication processing is achieved.
Patent Information
- Application Number
- CN202411425049.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Traditional image deduplication algorithms focus more on the overall image rather than the local content, resulting in poor deduplication efficiency and accuracy in application scenarios that require attention to the local content of the image.
The OpenPose-GLCM-hash algorithm is adopted to extract the global texture features and local posture features of the image through gray-level co-occurrence matrix GLCM hash processing and the improved OpenPose algorithm, generate a composite hash code, and use the Jaccard distance to judge the image similarity for deduplication.
The accuracy and efficiency of image deduplication are improved, local details of the image can be more accurately identified, and the misjudgment rate is reduced.
Smart Images

Figure CN119516246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power distribution safety and supervision operations, and in particular to a data cleaning method and system for power distribution safety and supervision operations. Background Art
[0002] To ensure safety during power distribution safety inspections, surveillance equipment is often deployed for real-time monitoring and video recording. These devices capture detailed on-site conditions, providing a crucial basis for subsequent analysis and the development of safety regulations. Extracting frames from surveillance video and inspecting and labeling them for safety compliance is a crucial step in ensuring operational safety. However, because surveillance equipment typically captures images at a high frequency, the resulting frame image data is enormous and contains numerous similar images carrying identical information. Without proper screening, this process wastes significant time on repetitive and meaningless work, generating a high degree of overlap and useless image data.
[0003] Therefore, it is necessary to clean these frame image data. The existing cleaning method generally uses the OpenCV library and other methods to extract frames from the video, and then uses an image deduplication algorithm to deduplicate several video frames. Traditional image deduplication algorithms are generally AVG-hash, DCT-hash or BDCT-hash algorithms. These algorithms focus more on the overall image rather than the local content of the image. Therefore, these algorithms have certain limitations in the application process. For application scenarios that need to pay attention to the local content of the image, these algorithms have poor efficiency and accuracy in image deduplication. Summary of the Invention
[0004] In response to the above-mentioned defects, the present invention proposes a data cleaning method and system for power distribution safety and supervision operations, aiming to solve the problem that traditional image deduplication algorithms focus more on the overall image rather than the local content of the image, resulting in poor deduplication efficiency and accuracy in application scenarios that require attention to the local content of the image.
[0005] To achieve this object, the present invention adopts the following technical solutions:
[0006] A data cleaning method for power distribution safety supervision operations includes the following steps:
[0007] Step S1: Collecting videos of power distribution safety supervision operations;
[0008] Step S2: extracting a number of frame images from the video of the power distribution safety supervision operation and forming a frame image sequence;
[0009] Step S3: continuously selecting any two frame images from the frame image sequence, and performing steps S4 to S7 on them, and repeating this process until all frame images in the frame image sequence have been compared and processed accordingly;
[0010] Step S4: performing gray-level co-occurrence matrix (GLCM) hashing on the two frame images to obtain global texture feature hash codes of the two frame images;
[0011] Step S5: using the improved OpenPose algorithm to extract local posture features from the two frame images respectively, and performing hash calculations on the two local posture features respectively to obtain local posture feature hash codes of the two frame images;
[0012] Step S6: combining the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images;
[0013] Step S7: Calculate the Jaccard distance between the composite hash codes of the two frame images and determine whether the Jaccard distance between the composite hash codes of the two frame images is less than a preset threshold ε. If so, delete one of the frame images and its corresponding composite hash code. If not, retain both frame images to complete the frame image data cleaning.
[0014] Preferably, in step S4, gray level co-occurrence matrix GLCM hash processing is performed on the frame image to obtain a global texture feature hash code of the frame image, which specifically includes the following sub-steps:
[0015] Step S41: converting the frame image into a grayscale image;
[0016] Step S42: calculating the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct a GLCM;
[0017] Step S43: extracting texture features from the GLCM, where the texture features include energy, contrast, entropy, and correlation;
[0018] Step S44: performing hash processing on the texture features to generate a global texture feature hash code.
[0019] Preferably, in step S5, the improved OpenPose algorithm is used to extract local posture features from the frame image, and the local posture features are hashed to obtain a hash code of the local posture features of the frame image, which specifically includes the following sub-steps:
[0020] Step S51: using the improved OpenPose algorithm to extract information of 14 key skeleton joints from the frame image, and arranging the information of the 14 key skeleton joints in a certain order to form a skeleton joint sequence;
[0021] Step S52: Establishing a long short-term memory network LSTM model;
[0022] Step S53: Input the skeleton joint point sequence into the LSTM model for processing and output the local posture feature vector;
[0023] Step S54: Use supervised deep hashing (SDH) to convert the local posture feature vector into a binary local posture feature hash code.
[0024] Preferably, in step S6, the global texture feature hash code of the frame image is combined with the local posture feature hash code of the frame image to generate a composite hash code of the frame image, which specifically includes the following sub-steps:
[0025] Step S61: combining the global texture feature hash code T of the frame image and the local posture feature hash code B of the frame image into a hash code F=[TB], where the length of the hash code F is 80;
[0026] Step S62: Generate a pseudo-random secret stream of length 80 using a key, sort the elements in the pseudo-random secret stream, and record the original position of each element to generate a vector Z;
[0027] Step S63: Use vector Z to reorder the elements in hash code F to obtain a new hash code H, where the relationship between the elements in the new hash code H and the elements in vector Z satisfies the following formula:
[0028] h(q)=f(z(q));
[0029] Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z;
[0030] Step S64: quantizing the elements in the new hash code H to obtain a quantized new hash code H, which is the composite hash code of the frame image.
[0031] Preferably, in step S7, the Jaccard distance between the composite hash codes of the two frame images is calculated, which specifically includes the following sub-steps:
[0032] Step S71: converting the composite hash codes of the two frame images into two sets using a mapping method;
[0033] Step S72: Calculate the size of the intersection and union of the two sets;
[0034] Step S73: Calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
[0035]
[0036] Another aspect of the present application provides a data cleaning system for power distribution safety and supervision operations, the system comprising:
[0037] Acquisition module, used to collect videos of power distribution safety and supervision operations;
[0038] An extraction module is used to extract several frame images from the video of power distribution safety supervision operations and form a frame image sequence;
[0039] A selection and execution module is used to continuously select any two frame images from the frame image sequence and execute the texture feature hash code calculation module, the posture feature hash code calculation module, the composite hash code generation module, the calculation module and the judgment module on them, repeating this process until all frame images in the frame image sequence have been compared and processed accordingly;
[0040] The texture feature hash code calculation module is used to perform gray level co-occurrence matrix GLCM hash processing on the two frame images respectively to obtain the global texture feature hash codes of the two frame images;
[0041] The posture feature hash code calculation module is used to extract local posture features from the two frame images using the improved OpenPose algorithm, and perform hash calculations on the two local posture features to obtain the local posture feature hash codes of the two frame images;
[0042] A composite hash code generation module is used to combine the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images;
[0043] A calculation module, used for calculating the Jaccard distance between the composite hash codes of two frame images;
[0044] The judgment module is used to determine whether the Jaccard distance between the composite hash codes of two frame images is less than a preset threshold ε. If so, one of the frame images and its corresponding composite hash code is deleted. If not, both frame images are retained to complete the cleaning of the frame image data.
[0045] Preferably, the texture feature hash code calculation module includes:
[0046] A first conversion submodule, configured to convert a frame image into a grayscale image;
[0047] The first calculation submodule is used to calculate the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct the GLCM;
[0048] The first extraction submodule extracts texture features from GLCM, and the texture features include energy, contrast, entropy and correlation;
[0049] The first generation submodule is used to perform hash processing on the texture features to generate a global texture feature hash code.
[0050] Preferably, the posture feature hash code calculation module includes:
[0051] The second extraction submodule is used to extract information of 14 key skeleton joints from the frame image using the improved OpenPose algorithm;
[0052] The first sorting submodule is used to arrange the information of the 14 skeleton joints in a certain order to form a skeleton joint sequence;
[0053] Establish a submodule for building a long short-term memory network LSTM model;
[0054] The input submodule is used to input the skeleton joint point sequence into the LSTM model for processing;
[0055] Output submodule, used to output local posture feature vector;
[0056] The second conversion submodule is used to convert the local posture feature vector into a binary local posture feature hash code by using supervised deep hashing (SDH).
[0057] Preferably, the composite hash code generation module includes:
[0058] A combining submodule, configured to combine a global texture feature hash code T of a frame image and a local posture feature hash code B of a frame image into a hash code F = [TB], wherein the length of the hash code F is 80;
[0059] The second generating submodule is used to generate a pseudo-random secret stream with a length of 80 using a key;
[0060] a second sorting submodule, for sorting elements in the pseudo-random secret stream;
[0061] a recording submodule, for recording the original position of each element in the pseudo-random secret stream to generate a vector Z;
[0062] The third sorting submodule is used to reorder the elements in the hash code F using the vector Z to obtain a new hash code H, wherein the relationship between the elements in the new hash code H and the elements in the vector Z satisfies the following formula:
[0063] h(q)=f(z(q));
[0064] Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z;
[0065] The quantization submodule is used to quantize the elements in the new hash code H to obtain the quantized new hash code H, which is the composite hash code of the frame image.
[0066] Preferably, the calculation module includes:
[0067] A third conversion submodule is used to convert the composite hash codes of the two frame images into two sets by using a mapping method;
[0068] The second calculation submodule is used to calculate the size of the intersection and union of two sets;
[0069] The third calculation submodule is used to calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
[0070]
[0071] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0072] This solution uses the OpenPose-GLCM-hash algorithm to deduplicate several frames extracted from videos of power distribution safety and monitoring operations. The OpenPose-GLCM-hash algorithm effectively combines OpenPose human pose detection with gray-level co-occurrence matrix (GLCM) feature extraction technology, capturing the overall structural information of the image while enhancing the ability to identify local dynamic features of people within the image. This enables the algorithm to more accurately identify local details in applications that require attention to local image content, effectively reducing the false positive rate and improving the efficiency and accuracy of deduplication. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 The invention discloses a flowchart of the steps of a data cleaning method for power distribution safety and supervision operations. DETAILED DESCRIPTION
[0074] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and are not to be construed as limiting the present invention.
[0075] A data cleaning method for power distribution safety supervision operations includes the following steps:
[0076] Step S1: Collecting videos of power distribution safety supervision operations;
[0077] Step S2: extracting a number of frame images from the video of the power distribution safety supervision operation and forming a frame image sequence;
[0078] Step S3: continuously selecting any two frame images from the frame image sequence, and performing steps S4 to S7 on them, and repeating this process until all frame images in the frame image sequence have been compared and processed accordingly;
[0079] Step S4: performing gray-level co-occurrence matrix (GLCM) hashing on the two frame images to obtain global texture feature hash codes of the two frame images;
[0080] Step S5: using the improved OpenPose algorithm to extract local posture features from the two frame images respectively, and performing hash calculations on the two local posture features respectively to obtain local posture feature hash codes of the two frame images;
[0081] Step S6: combining the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images;
[0082] Step S7: Calculate the Jaccard distance between the composite hash codes of the two frame images and determine whether the Jaccard distance between the composite hash codes of the two frame images is less than a preset threshold ε. If so, delete one of the frame images and its corresponding composite hash code. If not, retain both frame images to complete the frame image data cleaning.
[0083] This solution is a data cleaning method for power distribution safety supervision operations, such as Figure 1As shown, the first step is to capture video of the power distribution safety and monitoring operation. In this embodiment, monitoring equipment is deployed at the power distribution safety and monitoring operation site to capture the video of the power distribution safety and monitoring operation in real time. This facilitates capturing the real-time conditions of the operation site, such as worker operations, equipment operating status, and compliance with safety measures. The second step is to extract several frames from the power distribution safety and monitoring operation video to form a frame image sequence. In this embodiment, frame extraction processing of the power distribution safety and monitoring operation video facilitates video processing efficiency. The third step is to continuously select any two frames from the frame image sequence and perform steps S4 to S7 on them, repeating this process until all frames in the frame image sequence have been compared and processed accordingly. In this embodiment, two unprocessed frames are selected from the frame image sequence and similarity analysis is performed on the two frames. If the similarity between the two frames exceeds a set threshold, they are considered identical, and only one frame image is retained to achieve the effect of deduplication. If the similarity between the two frames is below the set threshold, both frames are retained. After all frames in the frame image sequence have been compared and processed pairwise, the resulting frame image sequence is a deduplicated sequence. The fourth step is to perform gray-level co-occurrence matrix (GLCM) hashing on each of the two frame images to obtain global texture feature hash codes for the two frame images. In this embodiment, performing GLCM hashing on the frame images can yield a global texture feature hash code representing the overall image content. GLCM calculates the frequency of occurrence of pixel pairs with specific values and spatial relationships within an image, displaying comprehensive information about the image's direction, spacing, and amplitude variations. In this embodiment, four GLCM parameters—contrast, correlation, energy, and uniformity—are used to describe global texture features. The fifth step is to extract local pose features from each of the two frame images using an improved OpenPose algorithm. These two local pose features are then hashed to obtain local pose feature hash codes for the two frame images. In this embodiment, the improved OpenPose algorithm is used to extract pose features of 14 skeletal joints from the frame images. These pose features are then converted into binary feature codes for efficient pose matching and retrieval. To further illustrate, the improved OpenPose algorithm replaces the first ten layers of the feature extraction network of the traditional OpenPose model from the VGG19 architecture with the MobileNet architecture. The MobileNet architecture significantly reduces the computational complexity and number of parameters of the OpenPose model by using depthwise separable convolutions, while maintaining good performance. The sixth step is to combine the global texture feature hash codes of the two frame images with the local pose feature hash codes of the corresponding frame images to generate a composite hash code for the two frame images. In this embodiment, by combining the global texture feature hash codes and the local pose feature hash codes of the frame images, the resulting composite hash code can reflect the overall content and pose characteristics of the frame images.The seventh step is to calculate the Jaccard distance between the composite hash codes of the two frame images and determine whether the Jaccard distance between the composite hash codes of the two frame images is less than a preset threshold ε. If so, one of the frame images and its corresponding composite hash code is deleted. If not, both frame images are retained to complete the frame image data cleaning. In this embodiment, the preset threshold ε is 0.5. The Jaccard distance, as a similarity metric, can be used to detect the similarity between the two frame images. By calculating the Jaccard distance between the composite hash codes of the two frame images, the degree of similarity between the images can be effectively determined. Further, when the Jaccard distance is less than the preset threshold ε, it means that the overall content and posture features of the two frame images are highly similar, and image deduplication processing is required.
[0084] This solution uses the OpenPose-GLCM-hash algorithm to deduplicate several frames extracted from videos of power distribution safety and monitoring operations. The OpenPose-GLCM-hash algorithm effectively combines OpenPose human pose detection with gray-level co-occurrence matrix (GLCM) feature extraction technology, capturing the overall structural information of the image while enhancing the ability to identify local dynamic features of people within the image. This enables the algorithm to more accurately identify local details in applications that require attention to local image content, effectively reducing the false positive rate and improving the efficiency and accuracy of deduplication.
[0085] Preferably, in step S4, gray level co-occurrence matrix GLCM hash processing is performed on the frame image to obtain a global texture feature hash code of the frame image, which specifically includes the following sub-steps:
[0086] Step S41: converting the frame image into a grayscale image;
[0087] Step S42: calculating the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct a GLCM;
[0088] Step S43: extracting texture features from the GLCM, where the texture features include energy, contrast, entropy, and correlation;
[0089] Step S44: performing hash processing on the texture features to generate a global texture feature hash code.
[0090] Specifically, in step S41, converting the original frame image into a grayscale image helps simplify the complexity of image processing. In step S42, GLCM is a matrix whose elements represent the frequency of occurrence of two pixel grayscale value pairs at a given direction and distance. In this embodiment, the given distance d is 1 and the given direction θ is 45°. In step S43, multiple texture features can be extracted from the GLCM: energy, contrast, entropy, and correlation. Energy is calculated by calculating the sum of the squares of each element in the GLCM matrix and is used to measure the uniformity of the image texture. Higher energy indicates more uniform texture. Contrast is calculated by calculating the variance of each element in the GLCM matrix and reflects the contrast of the image grayscale levels. Higher contrast indicates clearer texture. Entropy describes the randomness of the image texture. Higher entropy indicates more complex texture. Correlation is calculated by calculating the correlation coefficient of each pair of elements in the GLCM matrix and reflects the linear correlation between the image grayscale levels. In step S44, hashing is generally a function that maps data of arbitrary length to shorter fixed-length data, converting texture features into global texture feature hash codes that can reflect the overall content of the image.
[0091] Preferably, in step S5, the improved OpenPose algorithm is used to extract local posture features from the frame image, and the local posture features are hashed to obtain the local posture feature hash code of the frame image, which specifically includes the following sub-steps:
[0092] Step S51: using the improved OpenPose algorithm to extract information of 14 key skeleton joints from the frame image, and arranging the information of the 14 key skeleton joints in a certain order to form a skeleton joint sequence;
[0093] Step S52: Establishing a long short-term memory network LSTM model;
[0094] Step S53: Input the skeleton joint point sequence into the LSTM model for processing and output the local posture feature vector;
[0095] Step S54: Use supervised deep hashing (SDH) to convert the local posture feature vector into a binary local posture feature hash code.
[0096] In this embodiment, in step S51, the 14 key skeleton joints extracted from the frame image include the head, shoulders, elbows, wrists, hips, knees, and ankles of the human body. In step S52, by establishing an LSTM model, the subsequent processing of the skeleton joint sequence is facilitated. In step S53, after the LSTM model receives the skeleton joint sequence, the LSTM captures the dynamic changes of the skeleton joints in the time series through the mechanism of forget gate, input gate, and output gate. Specifically, for the position of the skeleton joints in each frame, the LSTM generates corresponding meta-features. These meta-features describe the changes in human posture in the time series, thereby capturing complex motion patterns. In one embodiment, when it is necessary to identify whether a person is performing a specific hand movement, a sequence of wrist and palm joint coordinates containing multiple time steps is used as input features, and the LSTM model is used to process these sequence data. The LSTM model includes LSTM layers, each of which outputs a hidden state vector. The hidden state vector output by the last layer in the LSTM layer is extracted as a local posture feature vector, which captures key information related to the hand movement. In step S54, SDH optimizes the hashing process by relaxing the loss function to ensure that similar posture features are mapped to similar binary codes. By converting the high-dimensional posture feature vector into a compact binary hash code, subsequent storage, transmission, and retrieval operations are facilitated. In one embodiment, a local posture feature vector f = [f1, f2, ..., f a ], where a is the dimension of the feature, which can be converted into a binary hash code h = [h1, h2, ..., h b ], where a is much smaller than b. The specific conversion steps are as follows: the first step is to establish the SDH model; the second step is to input the local posture feature vector f into the SDH model for processing; the third step is to output the real vector z = [z1, z2, ..., z m ]; The fourth step is to convert each element in z using the sign function to obtain the binary value set s = [sign(z1), sign(z2), ..., sign(z m )], where the sign function maps positive numbers to 1 and negative numbers to 0.
[0097] Preferably, in step S6, the global texture feature hash code of the frame image is combined with the local posture feature hash code of the frame image to generate a composite hash code of the frame image, which specifically includes the following sub-steps:
[0098] Step S61: combining the global texture feature hash code T of the frame image and the local posture feature hash code B of the frame image into a hash code F=[TB], where the length of the hash code F is 80;
[0099] Step S62: Generate a pseudo-random secret stream of length 80 using a key, sort the elements in the pseudo-random secret stream, and record the original position of each element to generate a vector Z;
[0100] Step S63: Use vector Z to reorder the elements in hash code F to obtain a new hash code H, where the relationship between the elements in the new hash code H and the elements in vector Z satisfies the following formula:
[0101] h(q)=f(z(q));
[0102] Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z;
[0103] Step S64: quantizing the elements in the new hash code H to obtain a quantized new hash code H, which is the composite hash code of the frame image.
[0104] In this embodiment, in step S62, a pseudo-random secret stream of length 80 is generated using a key to construct a secure hash. A vector Z is generated, which represents the index of the sorted elements in the original sequence. In step S63, the elements in the hash code F are reordered using vector Z to obtain a new hash code H. This means that if the qth element of vector Z is m, then the qth element of the new hash code H is the mth element of hash code F. In step S64, the elements in the new hash code H are quantized, which helps save storage space and improve security.
[0105] Preferably, in step S7, the Jaccard distance between the composite hash codes of the two frame images is calculated, which specifically includes the following sub-steps:
[0106] Step S71: converting the composite hash codes of the two frame images into two sets using a mapping method;
[0107] Step S72: Calculate the size of the intersection and union of the two sets;
[0108] Step S73: Calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
[0109]
[0110] In this embodiment, when calculating the Jaccard distance between two composite hash codes, the composite hash codes need to be converted into sets because the Jaccard distance is a metric used to measure the difference between two sets. It is calculated based on the intersection and union of sets, and composite hash codes are not sets. Calculating the Jaccard distance facilitates subsequent detection of the similarity between the two frame images.
[0111] Another aspect of the present application provides a data cleaning system for power distribution safety and supervision operations, the system comprising:
[0112] Acquisition module, used to collect videos of power distribution safety and supervision operations;
[0113] An extraction module is used to extract several frame images from the video of power distribution safety supervision operations and form a frame image sequence;
[0114] A selection and execution module is used to continuously select any two frame images from the frame image sequence and execute the texture feature hash code calculation module, the posture feature hash code calculation module, the composite hash code generation module, the calculation module and the judgment module on them, repeating this process until all frame images in the frame image sequence have been compared and processed accordingly;
[0115] The texture feature hash code calculation module is used to perform gray level co-occurrence matrix GLCM hash processing on the two frame images respectively to obtain the global texture feature hash codes of the two frame images;
[0116] The posture feature hash code calculation module is used to extract local posture features from the two frame images using the improved OpenPose algorithm, and perform hash calculations on the two local posture features to obtain the local posture feature hash codes of the two frame images;
[0117] A composite hash code generation module is used to combine the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images;
[0118] A calculation module, used for calculating the Jaccard distance between the composite hash codes of two frame images;
[0119] The judgment module is used to determine whether the Jaccard distance between the composite hash codes of two frame images is less than a preset threshold ε. If so, one of the frame images and its corresponding composite hash code is deleted. If not, both frame images are retained to complete the cleaning of the frame image data.
[0120] This solution, a data cleaning system for power distribution safety and monitoring operations, cleans several frames extracted from power distribution safety and monitoring videos through the coordinated efforts of an acquisition module, an extraction module, a selection and execution module, a texture feature hash code calculation module, a posture feature hash code calculation module, a composite hash code generation module, a calculation module, and a judgment module. This solution uses the OpenPose-GLCM-hash algorithm to deduplicate frames extracted from power distribution safety and monitoring videos. The OpenPose-GLCM-hash algorithm effectively integrates OpenPose human pose detection and gray-level co-occurrence matrix (GLCM) feature extraction technology, capturing the overall structural information of the image while enhancing the ability to recognize local dynamic features of people within the image. This enables the algorithm to more accurately identify local details in applications requiring attention to local image content, effectively reducing false positives and improving deduplication efficiency and accuracy.
[0121] Preferably, the texture feature hash code calculation module includes:
[0122] A first conversion submodule, configured to convert a frame image into a grayscale image;
[0123] The first calculation submodule is used to calculate the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct the GLCM;
[0124] The first extraction submodule extracts texture features from GLCM, and the texture features include energy, contrast, entropy and correlation;
[0125] The first generation submodule is used to perform hash processing on the texture features to generate a global texture feature hash code.
[0126] Specifically, in the first conversion submodule, by converting the original frame image into a grayscale image, it is helpful to simplify the complexity of image processing. In the first calculation submodule, GLCM is a matrix whose elements represent the frequency of occurrence of two pixel grayscale value pairs at a given direction and distance. In this embodiment, the given distance d is 1 and the given direction θ is 45°. In the first extraction submodule, a variety of texture features can be extracted from GLCM, namely energy, contrast, entropy and correlation. Energy can measure the uniformity of image texture. The higher the energy, the more uniform the texture; contrast can reflect the contrast of image grayscale. The higher the contrast, the clearer the texture; entropy can describe the randomness of image texture. The larger the entropy, the more complex the texture; correlation can reflect the linear correlation between image grayscale levels. In the first generation submodule, hash processing is usually a function that maps data of arbitrary length to shorter fixed-length data, converting texture features into global texture feature hash codes, which can reflect the overall content of the image.
[0127] Preferably, the posture feature hash code calculation module includes:
[0128] The second extraction submodule is used to extract information of 14 key skeleton joints from the frame image using the improved OpenPose algorithm;
[0129] The first sorting submodule is used to arrange the information of the 14 skeleton joints in a certain order to form a skeleton joint sequence;
[0130] Establish a submodule for building a long short-term memory network LSTM model;
[0131] The input submodule is used to input the skeleton joint point sequence into the LSTM model for processing;
[0132] Output submodule, used to output local posture feature vector;
[0133] The second conversion submodule is used to convert the local posture feature vector into a binary local posture feature hash code by using supervised deep hashing (SDH).
[0134] In this embodiment, in the second extraction submodule, the 14 key skeleton joints extracted from the frame image include the head, shoulders, elbows, wrists, hips, knees and ankles of the human body. In the establishment submodule, by establishing an LSTM model, it is beneficial to the subsequent processing of the skeleton joint sequence. In the input submodule, after the LSTM model receives the skeleton joint sequence, the LSTM captures the dynamic changes of the skeleton joints in the time series through the mechanism of forgetting gate, input gate and output gate. Specifically, for the position of the skeleton joints in each frame, LSTM generates corresponding meta-features. These meta-features describe the changes in human posture in the time series, so that complex motion patterns can be captured. In the second conversion submodule, SDH optimizes the hash process by relaxing the loss function to ensure that similar posture features are mapped to similar binary codes. By converting high-dimensional posture feature vectors into compact binary hash codes, subsequent storage, transmission and retrieval operations are facilitated.
[0135] Preferably, the composite hash code generation module includes:
[0136] A combining submodule, configured to combine a global texture feature hash code T of a frame image and a local posture feature hash code B of a frame image into a hash code F = [TB], wherein the length of the hash code F is 80;
[0137] The second generating submodule is used to generate a pseudo-random secret stream with a length of 80 using a key;
[0138] a second sorting submodule, for sorting elements in the pseudo-random secret stream;
[0139] a recording submodule, for recording the original position of each element in the pseudo-random secret stream to generate a vector Z;
[0140] The third sorting submodule is used to reorder the elements in the hash code F using the vector Z to obtain a new hash code H, wherein the relationship between the elements in the new hash code H and the elements in the vector Z satisfies the following formula:
[0141] h(q)=f(z(q));
[0142] Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z;
[0143] The quantization submodule is used to quantize the elements in the new hash code H to obtain the quantized new hash code H, which is the composite hash code of the frame image.
[0144] In this embodiment, the second generation module uses a key to generate a pseudo-random secret stream of length 80, which is used to construct a secure hash. In the third sorting submodule, the elements in the hash code F are reordered using the vector Z to generate a new hash code H. This means that if the qth element of the vector Z is m, then the qth element of the new hash code H is the mth element of the hash code F. In the quantization submodule, the elements in the new hash code H are quantized, which helps save storage space and improve security.
[0145] Preferably, the calculation module includes:
[0146] A third conversion submodule is used to convert the composite hash codes of the two frame images into two sets by using a mapping method;
[0147] The second calculation submodule is used to calculate the size of the intersection and union of two sets;
[0148] The third calculation submodule is used to calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
[0149]
[0150] In this embodiment, the third conversion submodule, the second calculation submodule and the third calculation submodule cooperate with each other to calculate the Jaccard distance between two composite hash codes, which facilitates the subsequent detection of the similarity between two frame images.
[0151] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
[0152] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are exemplary and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A data cleaning method for power distribution safety and monitoring operations, characterized by: The following steps are involved: Step S1: Collecting videos of power distribution safety supervision operations; Step S2: extracting a number of frame images from the video of the power distribution safety supervision operation and forming a frame image sequence; Step S3: continuously selecting any two frame images from the frame image sequence, and performing steps S4 to S7 on them, and repeating this process until all frame images in the frame image sequence have been compared and processed accordingly; Step S4: performing gray-level co-occurrence matrix (GLCM) hashing on the two frame images to obtain global texture feature hash codes of the two frame images; Step S5: using the improved OpenPose algorithm to extract local posture features from the two frame images respectively, and performing hash calculations on the two local posture features respectively to obtain local posture feature hash codes of the two frame images; Step S6: combining the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images; Step S7: Calculate the Jaccard distance between the composite hash codes of the two frame images and determine whether the Jaccard distance between the composite hash codes of the two frame images is less than a preset threshold ε. If so, delete one of the frame images and its corresponding composite hash code. If not, retain both frame images to complete the frame image data cleaning.
2. A data cleaning method for power distribution safety and monitoring operations according to claim 1, characterized in that: In step S4, gray level co-occurrence matrix GLCM hashing is performed on the frame image to obtain a global texture feature hash code of the frame image, which specifically includes the following sub-steps: Step S41: converting the frame image into a grayscale image; Step S42: calculating the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct a GLCM; Step S43: extracting texture features from the GLCM, where the texture features include energy, contrast, entropy, and correlation; Step S44: performing hash processing on the texture features to generate a global texture feature hash code.
3. The data cleaning method for power distribution safety monitoring operations according to claim 1 is characterized by: In step S5, the improved OpenPose algorithm is used to extract local posture features from the frame image, and the local posture features are hashed to obtain the local posture feature hash code of the frame image. The specific steps include the following: Step S51: using the improved OpenPose algorithm to extract information of 14 key skeleton joints from the frame image, and arranging the information of the 14 key skeleton joints in a certain order to form a skeleton joint sequence; Step S52: Establishing a long short-term memory network LSTM model; Step S53: Input the skeleton joint point sequence into the LSTM model for processing and output the local posture feature vector; Step S54: Use supervised deep hashing (SDH) to convert the local posture feature vector into a binary local posture feature hash code.
4. The data cleaning method for power distribution safety monitoring operations according to claim 1 is characterized in that: In step S6, the global texture feature hash code of the frame image is combined with the local posture feature hash code of the frame image to generate a composite hash code of the frame image, which specifically includes the following sub-steps: Step S61: combining the global texture feature hash code T of the frame image and the local posture feature hash code B of the frame image into a hash code F=[TB], where the length of the hash code F is 80; Step S62: Generate a pseudo-random secret stream of length 80 using a key, sort the elements in the pseudo-random secret stream, and record the original position of each element to generate a vector Z; Step S63: Use vector Z to reorder the elements in hash code F to obtain a new hash code H, where the relationship between the elements in the new hash code H and the elements in vector Z satisfies the following formula: h(q)=f(z(q)); Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z; Step S64: quantizing the elements in the new hash code H to obtain a quantized new hash code H, which is the composite hash code of the frame image.
5. The data cleaning method for power distribution safety monitoring operations according to claim 1 is characterized in that: In step S7, the Jaccard distance between the composite hash codes of the two frame images is calculated, which specifically includes the following sub-steps: Step S71: converting the composite hash codes of the two frame images into two sets using a mapping method; Step S72: Calculate the size of the intersection and union of the two sets; Step S73: Calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
6. A data cleaning system for power distribution safety and monitoring operations, characterized by: Using the data cleaning method for power distribution safety and supervision operations according to any one of claims 1 to 5, the system includes: Acquisition module, used to collect videos of power distribution safety and supervision operations; An extraction module is used to extract several frame images from the video of power distribution safety supervision operations and form a frame image sequence; A selection and execution module is used to continuously select any two frame images from the frame image sequence and execute the texture feature hash code calculation module, the posture feature hash code calculation module, the composite hash code generation module, the calculation module and the judgment module on them, repeating this process until all frame images in the frame image sequence have been compared and processed accordingly; The texture feature hash code calculation module is used to perform gray level co-occurrence matrix GLCM hash processing on the two frame images respectively to obtain the global texture feature hash codes of the two frame images; The posture feature hash code calculation module is used to extract local posture features from the two frame images using the improved OpenPose algorithm, and perform hash calculations on the two local posture features to obtain the local posture feature hash codes of the two frame images; A composite hash code generation module is used to combine the global texture feature hash codes of the two frame images with the local posture feature hash codes of the corresponding frame images to generate a composite hash code of the two frame images; A calculation module, used for calculating the Jaccard distance between the composite hash codes of two frame images; The judgment module is used to determine whether the Jaccard distance between the composite hash codes of two frame images is less than a preset threshold ε. If so, one of the frame images and its corresponding composite hash code is deleted. If not, both frame images are retained to complete the cleaning of the frame image data.
7. The data cleaning system for power distribution safety and monitoring operations according to claim 6, characterized in that: The texture feature hash code calculation module includes: A first conversion submodule, configured to convert a frame image into a grayscale image; The first calculation submodule is used to calculate the gray level co-occurrence frequency of pixel pairs in the gray image at a given distance and direction to construct the GLCM; The first extraction submodule extracts texture features from GLCM, and the texture features include energy, contrast, entropy and correlation; The first generation submodule is used to perform hash processing on the texture features to generate a global texture feature hash code.
8. The data cleaning system for power distribution safety and monitoring operations according to claim 6, characterized in that: The posture feature hash code calculation module includes: The second extraction submodule is used to extract information of 14 key skeleton joints from the frame image using the improved OpenPose algorithm; The first sorting submodule is used to arrange the information of the 14 skeleton joints in a certain order to form a skeleton joint sequence; Establish a submodule for building a long short-term memory network LSTM model; The input submodule is used to input the skeleton joint point sequence into the LSTM model for processing; Output submodule, used to output local posture feature vector; The second conversion submodule is used to convert the local posture feature vector into a binary local posture feature hash code by using supervised deep hashing (SDH).
9. The data cleaning system for power distribution safety and monitoring operations according to claim 6, characterized in that: The composite hash code generation module includes: A combining submodule, configured to combine a global texture feature hash code T of a frame image and a local posture feature hash code B of a frame image into a hash code F = [TB], wherein the length of the hash code F is 80; The second generating submodule is used to generate a pseudo-random secret stream with a length of 80 using a key; a second sorting submodule, for sorting elements in the pseudo-random secret stream; a recording submodule, for recording the original position of each element in the pseudo-random secret stream to generate a vector Z; The third sorting submodule is used to reorder the elements in the hash code F using the vector Z to obtain a new hash code H, wherein the relationship between the elements in the new hash code H and the elements in the vector Z satisfies the following formula: h(q)=f(z(q)); Where h(q) represents the qth element in the new hash code H, z(q) represents the qth element in the vector Z, and f() represents the transformation function that reorders the vector Z; The quantization submodule is used to quantize the elements in the new hash code H to obtain the quantized new hash code H, which is the composite hash code of the frame image.
10. The data cleaning system for power distribution safety and monitoring operations according to claim 6, characterized in that: The calculation module includes: A third conversion submodule is used to convert the composite hash codes of the two frame images into two sets by using a mapping method; The second calculation submodule is used to calculate the size of the intersection and union of two sets; The third calculation submodule is used to calculate the Jaccard distance L between the composite hash codes of the two frame images based on the size of the intersection and union of the two sets. The specific calculation formula is as follows:
Citation Information
Patent Citations
Converged media information acquisition method based on 3D-CNN and CVV-GLCM
CN112149751A
Intelligent portrait composition method and device
CN114611589A