A method and system for inspection scene recognition based on big data
By introducing the image differential attention mechanism and the YOLOv5 model into the defect detection of power transmission equipment, the feature extraction and loss function are optimized to solve the problems of large calculation amount and backward model, and achieve efficient and accurate defect identification.
Patent Information
- Application Number
- CN202410911661.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-09
AI Technical Summary
In the existing technology, the transmission equipment defect detection method based on drone image recognition requires a large amount of calculation and the model is relatively backward, resulting in low recognition accuracy and low efficiency.
A target detection model based on the image differential attention mechanism is adopted, combined with the YOLOv5 model, to optimize feature extraction through image differential technology and attention mechanism, improve recognition accuracy and robustness, and use the cross-entropy loss function to optimize model performance.
It significantly optimizes the calculation process, improves image processing efficiency and recognition accuracy, enhances real-time inspection and recognition performance, can more accurately identify defects in transmission and distribution lines, and reduces false detections and missed detections.
Smart Images

Figure CN118470577B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and more specifically, to a method and system for inspection scene recognition based on big data. Background Art
[0002] Big data is a term widely used in various fields, referring to large, complex and rapidly generated data sets that cannot be processed by traditional data processing application software. The characteristics of big data can be described by the 4V model, namely data volume, data velocity, data variety and data authenticity. In recent years, with the rapid improvement of data generation and collection capabilities, the definition and scope of big data have been continuously expanded to cover more dimensions and characteristics, such as value and visualization. Inspection scene recognition refers to the use of advanced technical means to identify, analyze and record the environment and equipment in the inspection process to assist inspection personnel in completing inspection tasks and ensure the safety and stability of equipment and environment. This technology combines multiple technical means such as big data, image recognition, machine learning and deep learning, IoT, AR, speech recognition and natural language processing, and can collect and analyze various data in inspection scenes in real time. The comprehensive application of these technologies has enabled inspection scene recognition to show broad application prospects in many fields such as industrial equipment inspection, facility maintenance, safety inspection and environmental monitoring.
[0003] The patent document with publication number CN109544501B discloses a method for defect detection of power transmission equipment based on multi-source image feature matching of drones. The method first uses the SIFT algorithm to register the images taken by the drone, handles problems such as translation, stretching and scaling in the image, and then obtains the candidate detection area through the selective search algorithm. Next, these candidate areas are input into the convolutional neural network for processing, and finally the support vector machine model is used to perform the final defect identification on the processed image. However, although this method solves the problem of geometric transformation in drone images to a certain extent, its computational complexity is large and the model used is relatively backward, resulting in the overall accuracy rate cannot be fully guaranteed. Summary of the invention
[0004] In order to solve the problems of large amount of calculation and relatively backward model mentioned in the above background technology, the present invention provides solutions in the following aspects.
[0005] In a first aspect, the present invention provides a method for inspection scene recognition based on big data, the method comprising the following steps:
[0006] Acquire an inspection image, perform differential processing on the inspection image to obtain a corresponding differential image, and annotate the differential image to generate a data set;
[0007] Training an object detection model based on an image differential attention mechanism according to the dataset;
[0008] Among them, the target detection model includes a differential attention mechanism module and a classification module, and the differential attention mechanism module is used to: perform feature extraction on the inspection image and the corresponding differential image respectively, and extract feature tensors of the two; perform row convolution and global average pooling on the feature map in the feature tensor of the differential image to obtain a first feature tensor and multiply it with the feature map in the feature tensor of the inspection image to obtain a second feature tensor; perform row convolution and global average pooling on the feature map of the second feature tensor, calculate the feature difference within each row, multiply the pooling result and the result of the feature difference to obtain the feature vector corresponding to the feature map of the second feature tensor, use the maximum value of the eigenvalue in the feature vector as the weight coefficient, multiply the weight coefficient and the feature map of the second feature tensor to obtain the result of the image differential attention mechanism; use the result of the differential attention mechanism as the input of the classification module, and the output of the classification module is the output of the target detection model;
[0009] The inspection images collected in real time are input into the target detection model to identify the defects of the inspection equipment.
[0010] Although the existing power transmission equipment defect detection method has solved the translation, stretching and scaling problems in drone images to a certain extent, its calculation amount is still very large, resulting in low efficiency in practical applications. The present invention greatly optimizes the calculation process by introducing an image differential attention mechanism. Image differential technology performs differential processing on images of consecutive frames and only focuses on analyzing the difference parts, thereby greatly reducing unnecessary calculations. This method not only improves the efficiency of image processing, but also reduces the consumption of system resources, so that more data can be processed under the same hardware conditions, thereby improving the real-time performance of inspections.
[0011] In one embodiment, the target detection model further includes an input module, and the input module is used to decode the inspection video into image frames.
[0012] In one embodiment, the obtaining of the inspection image includes adopting drone photography; and the labeling of the differential image includes adopting a third-party Python tool labelImg.
[0013] In one embodiment, the differential image is a new image obtained by subtracting an image at a previous moment from an image at a later moment, and the differential image is obtained by performing image inversion on the new image.
[0014] In one embodiment, the weight coefficient calculation step includes:
[0015] The feature tensor of the difference image is convolved with a convolution kernel of size 1x3xc, where 1x3xc means that the height of the convolution kernel is 1, the width of the convolution kernel is 3, and the number of channels of the convolution kernel is c; obtained by global average pooling The characteristic matrix of x1xc; x1xc indicates the height of the convolution kernel. , the convolution kernel width is 1, and the number of channels of the convolution kernel is c. The feature matrix is multiplied by the feature tensor of the inspection image to obtain the fused feature tensor; the fused feature tensor is convolved with a convolution kernel of size 1x3xc, and then the fusion matrix is obtained through global average pooling, and the difference of each row is calculated by variance or range to obtain the difference matrix; the difference matrix is multiplied by the fused feature matrix, and the maximum value is obtained by column to obtain the weight coefficient.
[0016] In one embodiment, the target detection model is a yolov5 model.
[0017] The image differential attention mechanism is added to the yolov5 model, and the gradient algorithm is used to update the target detection model. When the target detection model reaches the preset training times α or the loss of the target detection model is less than the set threshold β, the training is stopped, and the optimal model is trained according to the evaluation index of the model, where α∈[100, 500], β∈[0.01, 0.1].
[0018] The models used in traditional methods are relatively backward and cannot fully utilize the advantages of modern deep learning technology, resulting in the recognition accuracy not being well guaranteed. The present invention significantly improves the recognition performance by introducing an attention mechanism based on image residuals and combining it with the advanced YOLOv5 model. As one of the most advanced target detection models currently, YOLOv5 has fast and accurate detection capabilities. By introducing an attention mechanism based on image residuals in the feature extraction module of YOLOv5, the model can focus more on the key features of the transmission and distribution lines, especially the features of the defective parts, thereby greatly improving the accuracy and robustness of recognition. This combination not only gives full play to the efficient detection capability of the YOLOv5 model, but also uses the residual attention mechanism to improve the model's ability to capture detailed features, making the overall recognition effect more reliable.
[0019] In one embodiment, the loss of the target detection model adopts cross entropy loss.
[0020] In one embodiment, the evaluation index of the target detection model prefers recall:
[0021]
[0022] in, Indicates that the evaluation index prefers recall rate, Indicates The number of correct predictions for class defects, Indicates the The defect type prediction is the number of non-defects, and the types of defects are divided into two categories: cracking and disconnection.
[0023] By optimizing feature extraction and differential attention mechanisms, the accuracy of transmission and distribution line defect recognition is significantly improved. Specifically, by extracting features from differential images and assigning weights based on the importance of feature channels, the model can more accurately identify wire areas and defect features. This method not only enhances the model's attention to wire areas, but also improves the ability to distinguish defect types through further analysis of differential features. In addition, the model's loss function uses cross-entropy loss, which further optimizes the model's performance in the defect recognition process, making the final recognition results more accurate and effectively reducing false detections and missed detections.
[0024] In a second aspect, the present invention provides a patrol scene recognition system based on big data, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the patrol scene recognition method based on big data described in any one of claims 1 to 8 is implemented.
[0025] The inspection scene recognition method and system of the present invention have strong adaptability and broad application prospects. By using drones combined with deep learning technology to inspect complex power grid environments, it can not only cope with different shooting angles and environmental changes, but also maintain an efficient working state in a variety of application scenarios.
[0026] The beneficial effects of the present invention are:
[0027] Although the existing power transmission equipment defect detection method has solved some image processing problems, the amount of calculation is still huge and the efficiency is low. The present invention significantly optimizes the calculation process by introducing an image-based differential attention mechanism, improves image processing efficiency and system resource utilization, and enhances the real-time inspection. The model of the traditional method is backward and the recognition accuracy is not high. The present invention combines the attention mechanism based on image residuals and the advanced YOLOv5 model to significantly improve the recognition performance and robustness. By optimizing feature extraction and differential attention mechanisms, the accuracy and reliability of power transmission and distribution line defect identification are further improved, and the cross entropy loss function is used to optimize the model performance. The inspection scene recognition method and system of the present invention have strong adaptability and broad application prospects. They can cope with complex power grid environments and various application scenarios, maintain an efficient working state, and provide reliable technical support for the maintenance and management of power transmission equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0029] Figure 1 is a flowchart schematically illustrating a method for inspection scene recognition based on big data according to an embodiment of the present invention;
[0030] Figure 2 is a flowchart schematically showing an image differential attention mechanism in a big data-based inspection scene recognition method according to an embodiment of the present invention;
[0031] Figure 3 is a diagram schematically showing the composition of a model module in a method for inspection scene recognition based on big data according to an embodiment of the present invention;
[0032] Figure 4 is a flowchart schematically illustrating a weight coefficient calculation method in a patrol scene recognition method based on big data according to an embodiment of the present invention;
[0033] Figure 5 is a flowchart schematically showing an inspection scene recognition system based on big data according to an embodiment of the present invention; DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0035] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0036] The embodiment of the inspection scene recognition method based on big data mainly includes two parts. The first part is the construction of a target detection model based on the image differential attention mechanism, and the second part is the training of the target detection model based on the image differential attention mechanism. Based on the trained target detection model, the inspection image collected in real time is recognized to identify the defects of the inspection equipment. The focus of the present invention is on the first part, which is described in detail below.
[0037] like Figure 3As shown, generally, the target detection model includes an input module, an attention mechanism module and a classification module. The main improvement of the present invention lies in the attention mechanism module. In order to distinguish it, the present invention is called a differential attention mechanism module. Therefore, the classification module mainly includes a classification layer, which will not be repeated.
[0038] The first part is the construction of the target detection model based on image differential attention mechanism.
[0039] like Figure 1 As shown, the inspection scene recognition method based on big data of the present invention includes:
[0040] S1: Obtain inspection video data from historical data, decode the inspection video into image frames, perform image difference processing and labeling to generate a data set.
[0041] Specifically, the historical data refers to the data collected and saved over a period of time in the past. In the inspection system, the historical data usually includes previous inspection videos, images, sensor data, etc., which are used for model training, fault prediction and trend analysis, etc. The decoding of the inspection video refers to converting the video data in a compressed or encoded format into image data that can be directly processed. The decoding process parses the video file into a series of image frames, which can be further used for analysis and processing.
[0042] Among them, the image frame is a single still image in the video. A video consists of continuous image frames, and the number of frames displayed per second is called the frame rate. After the video is decoded, each image frame can be extracted and processed separately. The differential processing refers to the pixel-level differential calculation of two consecutive frames of images to highlight the changed parts of the image. This technology is often used in motion detection and change detection to identify moving objects or changing areas by calculating the differences between adjacent frames. The labeling refers to annotating image data to identify areas or features of interest. In machine learning and computer vision, labeling is often used to generate training data sets, such as marking defect locations, categories, etc. on images to train models for automatic recognition.
[0043] The inspection image data is obtained by drone photography, and the image frame is labeled by a third-party tool labelImg in Python.
[0044] By acquiring inspection videos from historical data and decoding them, the videos are converted into image frames. Then, through differential processing, the changed areas in the image are identified and highlighted. Finally, the images are annotated using annotation tools to generate data sets for model training. This process not only simplifies the complexity of data processing, but also improves the accuracy and efficiency of defect identification.
[0045] S2: Construct an image-based differential attention mechanism.
[0046] like Figure 2 As shown, the flow chart of the image differential attention mechanism in the inspection scene recognition method based on big data of the present invention.
[0047] Specifically, the construction is based on the image differential attention mechanism, including:
[0048] The captured transmission and distribution line image and the corresponding differential image are input into the model, where the transmission and distribution line image is Figure 2 The inspection image shown in ; extracting the feature tensor of the power transmission and distribution line image and the feature tensor of the differential image corresponding thereto; performing 1x3 row convolution and global average pooling on the feature map in the feature tensor of the differential image to obtain a first feature tensor and multiplying it with the feature map in the feature tensor of the power transmission and distribution line image to obtain a second feature tensor;
[0049] The feature map of the second feature tensor is again subjected to row convolution and global average pooling, the feature difference within each row is calculated, the result of global average pooling and the result of feature difference are multiplied together to obtain the feature vector corresponding to the feature map, the maximum value of the eigenvalue in the feature vector is used as the weight coefficient of the feature map, the above operation is performed on each feature map to obtain the weight coefficient of each feature map, the weight coefficient is multiplied by the feature map, and the result of the image differential attention mechanism is output.
[0050] like Figure 4 As shown, the weight coefficient calculation flow chart in the inspection scene recognition method based on big data of the present invention is specifically:
[0051] The feature tensor of the difference image is convolved using a convolution kernel of size 1x3xc; obtained by global average pooling x1xc feature matrix; multiply the feature matrix with the feature tensor of the input image to obtain the fused feature tensor; convolve the fused feature tensor with a convolution kernel of size 1x3xc, and then obtain the fusion matrix through global average pooling, and calculate the difference of each row by row through variance or range to obtain the difference matrix; multiply the difference matrix with the fused feature matrix, and find the maximum value by column to obtain the weight coefficient; where c represents the number of channels of the convolution kernel, Represents the height of the convolution kernel.
[0052] The transmission and distribution line images are images of power grid lines taken by drones or other equipment, and these images are used to detect and identify defects in the lines. The differential image is an image obtained by pixel-level differential calculation from two consecutive frames of images, reflecting the changed part between the two frames of images, and is usually used to detect moving or changing objects. The model is divided into an input module, a feature extraction module and a classification module, among which the image differential attention mechanism is used in the feature extraction module. The feature tensor is a multidimensional array extracted from the input image by a deep learning model such as a convolutional neural network, which contains the feature information of the image for subsequent processing and analysis.
[0053] Among them, the row convolution is a convolution operation, which only performs convolution operations in a specific direction, such as rows, and is often used to process sequence data or feature extraction in a specific direction. The global average pooling is a pooling operation, which compresses the feature map by calculating the average value of the entire feature map to obtain a feature vector, which is often used to reduce feature dimensions and retain important information. The feature difference refers to the difference between rows or elements in the feature tensor, which is usually obtained by calculating the variance, range, etc., that is, it can reflect that the greater the difference, the greater the value, which is used to measure the degree of change of the feature. The feature vector is a one-dimensional vector obtained by global average pooling or other operations on the feature tensor, which contains important information of the feature map. The weight coefficient is calculated based on the eigenvalue of the feature vector, and is used to adjust the weight of the feature map to reflect the importance of each part of the feature map.
[0054] Through the above steps, the image differential attention mechanism is realized. First, the image frame is obtained by decoding the video and differential processing is performed. Then, the neural network is used to extract the feature tensor of the power transmission and distribution line image and the differential image. Then, the difference is calculated using row convolution and global average pooling, and weights are assigned according to the difference, and finally an enhanced feature representation is obtained. This method can effectively highlight the key features in the image and improve the accuracy and efficiency of power transmission and distribution line defect recognition.
[0055] The second part is the training of the target detection model based on the image differential attention mechanism. The training of the target detection model based on the image differential attention mechanism mainly includes the following steps: First, collect and preprocess data to generate differential images to highlight the changed areas. Then, build an attention mechanism and introduce the differential image into the model to enhance the attention to the changed areas. Next, design and integrate the basic network and attention module, which are responsible for feature extraction and target detection. Finally, the model is trained by defining the loss function, and the classification and regression heads are optimized to improve the detection accuracy and efficiency. .
[0056] S3: Build a target detection model based on the image differential attention mechanism.
[0057] Specifically, the image differential attention mechanism is added to the yolov5 model, and the gradient algorithm is used to update the target detection model. When the target detection model reaches the preset training times α or the loss of the target detection model is less than the set threshold β, the training is stopped and the optimal model is selected according to the evaluation indicators of the model.
[0058] For example, the preset training times α is 500 times, and the loss threshold β is 0.05, that is, when the training times reaches 500 times, the training is stopped, or when the loss of the target detection model is less than 0.05, the training is stopped.
[0059] The image differential attention mechanism is a mechanism that extracts the changed part and pays attention to it by comparing the difference between two consecutive frames of images, and is used to improve the model's attention to specific features. The target detection model is a machine learning model used to detect and locate specific targets in an image, such as yolov5. It can identify multiple objects in an image and output their locations and categories. The yolov5 is a real-time target detection model that can complete the target detection task through one forward propagation, and has the characteristics of fast speed and high accuracy.
[0060] Among them, the gradient algorithm is an optimization method that iteratively updates the model parameters to minimize the loss function by calculating the gradient of the loss function with respect to the model parameters. Commonly used gradient algorithms include gradient descent and stochastic gradient descent. The preset number of training times α is the maximum number of iterations of the training model, which is used to prevent the model from being overtrained or the training time is too long. The loss is an indicator that measures the difference between the model prediction and the true value. Common loss functions include cross entropy loss and mean square error loss. The training goal is to minimize the loss function. The set threshold is a stopping condition in the model training. When the loss value is less than the threshold, the training stops. The evaluation index is a standard for measuring the performance of the model. Common evaluation indicators include accuracy, precision and recall scores. When selecting the optimal model, the quality of the model is usually judged based on the evaluation index.
[0061] The evaluation index of the target detection model prefers recall rate, and the specific formula is as follows:
[0062]
[0063] in, Indicates that the evaluation index prefers recall rate, Indicates The number of correct predictions for class defects, Indicates the The defect type prediction is the number of no defects. The larger the evaluation index of the model, the better the prediction effect of the model. The types of defects are divided into two categories: cracking and disconnection.
[0064] In one embodiment, there are two types of line defects: cracking and disconnection. Assume that 50 images with the defect type of cracking are identified by the model, and the results are that 40 images are correctly identified, 5 images are identified as having no defects, and 5 images are identified as having disconnection defects; 50 images with the defect type of disconnection are identified by the model, and the results are that 40 images are correctly identified, and 10 images are identified as having cracking defects. The evaluation index of the model is calculated as follows:
[0065]
[0066] Through the above steps, the target detection model based on the image differential attention mechanism is realized. During the training process, the gradient descent algorithm is used to continuously optimize the model parameters. By setting the predetermined number of training times and loss threshold, the stop condition of the model training is controlled, and the optimal model is selected according to the evaluation index. This method effectively improves the target detection accuracy of the model in a complex power grid environment, especially the ability to identify defects in transmission and distribution lines.
[0067] S4: Input the real-time image frames into the target detection model to identify the defects of the inspection equipment.
[0068] Specifically, the real-time image frame is a sequence of images captured in real time from a camera device, such as a drone or a camera. These image frames are arranged in chronological order and reflect the real-time status of the monitoring scene. The identification of inspection equipment defects refers to the detection of various defects in the transmission and distribution lines, such as broken wires, cracks, damage, etc., through image analysis technology. The target detection model identifies these defects in the real-time image frames.
[0069] Through the above process, the task of inputting real-time image frames into the target detection model to identify defects in the inspection equipment is achieved. This embodiment shows how to use the yolov5 model and the differential image attention mechanism to enhance the accuracy and real-time performance of defect recognition.
[0070] Example of inspection scene recognition system based on big data:
[0071] like Figure 5 As shown, the flow chart of the inspection scene recognition system based on big data of the present invention includes a processor and a memory.
[0072] The present invention also provides an inspection scene recognition system based on big data. Figure 5 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a method for inspection scene recognition based on big data according to the first aspect of the present invention is implemented.
[0073] The inspection scene recognition system based on big data also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, and their settings and functions are known in the art, so they will not be described in detail here.
[0074] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0075] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0076] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for inspection scene recognition based on big data, characterized in that: include: Acquire an inspection image, perform differential processing on the inspection image to obtain a corresponding differential image, and annotate the differential image to generate a data set; Training an object detection model based on an image differential attention mechanism according to the dataset; Among them, the target detection model includes a differential attention mechanism module and a classification module, and the differential attention mechanism module is used to: perform feature extraction on the inspection image and the corresponding differential image respectively, and extract feature tensors of the two; perform row convolution and global average pooling on the feature map in the feature tensor of the differential image to obtain a first feature tensor and multiply it with the feature map in the feature tensor of the inspection image to obtain a second feature tensor; perform row convolution and global average pooling on the feature map of the second feature tensor, calculate the feature difference within each row, multiply the pooling result and the result of the feature difference to obtain the feature vector corresponding to the feature map of the second feature tensor, use the maximum value of the eigenvalue in the feature vector as the weight coefficient, multiply the weight coefficient and the feature map of the second feature tensor to obtain the result of the image differential attention mechanism; use the result of the differential attention mechanism as the input of the classification module, and the output of the classification module is the output of the target detection model; Input the inspection images collected in real time into the target detection model to identify the defects of the inspection equipment; The weight coefficient calculation step comprises: Use a convolution kernel of size 1x3xc to convolve the feature tensor of the difference image, where 1x3xc means that the height of the convolution kernel is 1, the width of the convolution kernel is 3, and the number of channels of the convolution kernel is c; Obtained through global average pooling The characteristic matrix of x1xc; x1xc indicates the height of the convolution kernel. , the convolution kernel width is 1; Multiply the feature matrix and the feature tensor of the inspection image to obtain a fused feature tensor; The fused feature tensor is convolved with a convolution kernel of size 1x3xc, and then the fusion matrix is obtained through global average pooling. The difference of each row is calculated by variance or range to obtain the difference matrix; Multiply the difference matrix by the fusion feature matrix and find the maximum value by column to get the weight coefficient.
2. The inspection scene recognition method based on big data according to claim 1 is characterized in that: The target detection model also includes an input module, which is used to decode the inspection video into image frames.
3. The inspection scene recognition method based on big data according to claim 1 is characterized in that: The obtaining of the inspection image includes adopting drone photography; and the labeling of the differential image includes adopting a third-party tool labelImg of Python.
4. The inspection scene recognition method based on big data according to claim 1 is characterized in that: The differential image is a new image obtained by subtracting the image at the previous moment from the image at the next moment, and the differential image is obtained by performing image inversion on the new image.
5. The inspection scene recognition method based on big data according to claim 1 is characterized in that: The target detection model is the yolov5 model; The image differential attention mechanism is added to the yolov5 model, and the gradient algorithm is used to update the target detection model. When the target detection model reaches the preset training times α or the loss of the target detection model is less than the set threshold β, the training is stopped, and the optimal model is trained according to the evaluation index of the target detection model, where α∈[100, 500], β∈[0.01, 0.1].
6. The inspection scene recognition method based on big data according to claim 5 is characterized in that: The loss of the target detection model adopts cross entropy loss.
7. The inspection scene recognition method based on big data according to claim 5 is characterized in that: The evaluation index of the target detection model prefers recall rate: ; in, Indicates that the evaluation index prefers recall rate, Indicates The number of correct predictions for class defects, Indicates The number of class defects predicted as no defects, Represents the total number of defect types; the defect types are divided into two categories: cracking and disconnection.
8. A patrol scene recognition system based on big data, characterized in that: It includes a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the inspection scene recognition method based on big data described in any one of claims 1 to 7 is implemented.
