FPN-based method and system for efficiently and intelligently identifying typical trees in complex environment
Through FPN deep learning architecture and computer vision technology, an automatic identification system was developed to solve the coverage and real-time problems of tree monitoring in transmission line corridors, and efficient and accurate tree identification and monitoring are achieved, reducing manual inspection costs and ensuring power facilities Safety.
Patent Information
- Application Number
- CN202410948608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-16
AI Technical Summary
Existing methods fail to achieve comprehensive coverage and real-time monitoring of transmission line corridors, making it difficult to detect and deal with the risks of trees posing a threat to power facilities in a timely manner.
Based on the deep learning architecture of the feature pyramid network (FPN), combined with drone and computer vision technology, an automatic recognition system is developed to realize real-time trees in complex environments through data acquisition, preprocessing, and feature pyramid network model construction and training. Identify and monitor.
Improve the efficiency and accuracy of tree identification, maintain high recognition accuracy and efficiency under complex environments of different lighting, weather and tree density, reduce manual inspection workload and cost, promptly detect potential safety hazards, and ensure the safe operation of transmission lines. .
Smart Images

Figure CN118968283A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent recognition technology, in particular to an efficient intelligent recognition method and system for typical trees in a complex environment based on FPN. Background Art
[0002] Trees are one of the main obstacles in transmission line corridors. Due to their vigorous growth, trees may touch transmission lines, causing short circuits, tripping, or even fires. Therefore, regular monitoring and maintenance of trees in transmission line corridors is crucial.
[0003] Traditional tree monitoring methods require manual inspections, which are time-consuming and inefficient, and cannot achieve full coverage and real-time monitoring of transmission line corridors. In addition, manual inspections are also limited by natural conditions such as weather and terrain, making it difficult to respond to emergencies.
[0004] Feature Pyramid Network (FPN) is a deep learning architecture for object detection that can extract information from feature maps at different scales to effectively handle objects of different sizes. FPN builds multi-scale feature representations through top-down and lateral connections, which is very useful for identifying trees of different sizes in transmission line corridors.
[0005] The FPN-based efficient intelligent identification technology for typical trees in complex environments aims to take advantage of the advantages of FPN and combine it with deep learning algorithms to develop a system that can automatically identify trees in transmission line corridors. The system can be deployed on drones, surveillance cameras, or other mobile devices to automatically identify the location, size, and type of trees by capturing and analyzing images in real time, thereby providing decision support for the maintenance of transmission line corridors. Using advanced computer vision technology to improve the efficiency and accuracy of tree identification will help ensure the safe operation of transmission lines. With the continuous advancement of technology, this intelligent identification technology is expected to play a greater role in the management of transmission line corridors in the future. Summary of the invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the problem to be solved by the present invention is: how to solve the problem that the existing methods cannot achieve comprehensive coverage and real-time monitoring of the transmission line corridor.
[0008] To solve the above technical problems, the present invention provides the following technical solutions: an efficient and intelligent method for identifying typical trees in complex environments based on FPN, comprising: collecting data on trees in transmission line corridors and preprocessing the collected data; constructing a feature pyramid network model and training the model; evaluating the trained model and identifying typical trees in complex environments.
[0009] As a preferred solution of the FPN-based efficient and intelligent identification method for typical trees in complex environments described in the present invention, the data collection includes taking the trees in the transmission line corridor as the target objects, and using an unmanned aerial vehicle equipped with a high-definition camera or a fixed camera to collect data in the transmission line corridor, the collected grayscale images cover different weather, lighting conditions and seasonal changes, and collect tree growth data; the tree growth data includes the tree height and chest height of the trees.
[0010] As a preferred solution of the FPN-based efficient intelligent identification method for typical trees in complex environments described in the present invention, the preprocessing of the collected data includes image format unification and preliminary standardization, dynamic range adjustment and illumination enhancement, occlusion processing, data annotation and final data set construction; the image format unification and preliminary standardization include converting all collected images into a unified format and size, treating fixed pattern noise as image background noise, collecting the original image, i.e., the calibration image, in a completely dark environment, and in the subsequent normal image acquisition process, subtracting each pixel value from the corresponding pixel value of the calibration image to eliminate the fixed pattern noise; the dynamic range adjustment and illumination enhancement include global adjustment of image contrast to compensate for the influence of illumination on image quality, which is expressed as:
[0011]
[0012] Where I′ is the image after contrast adjustment, I is the original image, min(I) is the minimum pixel value in the image, and max(I) is the maximum pixel value in the image. After contrast adjustment, the image is divided into multiple local areas. According to the brightness of the image, the brightness value is appropriately adjusted to keep the image constant when the illumination changes. The average brightness value of each local area is expressed as:
[0013]
[0014] Among them, L mean is the average brightness value of the local area, M is the number of rows in the local area, N is the number of columns in the local area, x is the xth row in the local area, y is the yth column in the local area, and I(x, y) is the brightness value of the image at (x, y); for the average brightness value of each local area, if L mean If it is greater than the brightness threshold T of the local area, the local image brightness is reduced, which is expressed as:
[0015] I″(x,y)=I′(x,y)-|L mean -T|
[0016] Where I′(x, y) is the image of the local area after contrast adjustment; for the average brightness value of each local area, if L meanIf it is less than the brightness threshold T of the local area, the local image brightness is increased, which is expressed as:
[0017] I″(x,y)=I′(x,y)+|L mean -T|
[0018] Where I″ is the image after brightness adjustment.
[0019] As a preferred solution of the FPN-based efficient intelligent identification method for typical trees in complex environments of the present invention, wherein: the brightness threshold of the local area is calculated in each local area using an adaptive threshold algorithm; the occlusion processing includes using local feature enhancement to enhance the features of the occluded area in other unoccluded areas, which is expressed as:
[0020] I en (x, y)=I″(x, y)+α·(I″(x, y)-L mean )
[0021] Among them, I en (x, y) is the local image after local feature enhancement, and α is the enhancement coefficient.
[0022] As a preferred solution of the FPN-based efficient and intelligent identification method for typical trees in complex environments described in the present invention, the data annotation includes annotating the trees in the image using an image annotation tool. Before annotation, the annotation standards and rules are determined, including position and category information and the annotation format; for the tree identification task, a bounding box annotation method is used to draw a rectangular box on the image to frame the main part of the tree, and the coordinates of the bounding box are expressed as the pixel coordinates of the upper left corner and the lower right corner; the category of the tree in the box is specified next to the bounding box or in the corresponding annotation file. If there is only one tree category, only the bounding box is annotated. If there are multiple categories, the category of each box needs to be clearly annotated; the final data set construction includes allocating the preprocessed data to the training set, the validation set and the test set in proportion.
[0023] As a preferred solution of the FPN-based efficient and intelligent identification method for typical trees in complex environments described in the present invention, the construction of the feature pyramid network model includes using a pre-trained deep convolutional neural network as a feature extractor, and the feature extractor performs a convolution operation on the input image to generate feature maps of different levels; the feature pyramid network model FPN uses the feature maps of different levels generated by the feature extractor to construct a feature pyramid through bottom-up, lateral connection and top-down methods; the bottom-up includes gradually extracting feature maps from the bottom layer to the top layer of the VGG network, and the feature maps are used as inputs of the FPN from the bottom layer to the top layer; the top-down includes starting from the high layer of the VGG network and gradually generating features that match the bottom feature scale through upsampling. higher resolution feature map; the lateral connection includes combining the low-level feature map with the high-level feature map in a top-down process to form a feature pyramid; in each layer of the feature map in FPN, a channel attention mechanism is introduced to optimize the feature representation; the model training includes the model using labeled data to implement training, and updating the parameters of the model through a back-propagation algorithm, inputting the training data into the network, calculating the difference between the model output and the true label to obtain the value of the loss function, calculating the gradient according to the loss function, propagating the gradient of the output layer forward, calculating the gradient of each layer, until the gradient of the loss function of each parameter is calculated, and using the calculated gradient, the gradient descent optimization algorithm is used to update the model parameters.
[0024] As a preferred solution of the FPN-based efficient and intelligent identification method for typical trees in complex environments described in the present invention, the evaluation of the trained model includes verifying and evaluating the performance of the trained model by calculating the accuracy, recall and F1 value indicators, and optimizing the model according to the evaluation results; the optimization of the model includes adding regularization to optimize the model.
[0025] Another object of the present invention is to provide a system for an efficient and intelligent identification method of typical trees in complex environments based on FPN, which can solve the problem of efficient and intelligent identification of typical trees in complex environments based on FPN by constructing a typical tree identification system in complex environments.
[0026] In order to solve the above technical problems, the present invention provides the following technical solutions: an efficient and intelligent identification system for typical trees in complex environments based on FPN, comprising a data acquisition and processing module, a model construction module and a model evaluation module; the data acquisition and processing module is used to collect data from trees in the transmission line corridor and pre-process the collected data; the model construction module is used to construct a feature pyramid network model and train the model; the model evaluation module is used to evaluate the trained model and identify typical trees in complex environments.
[0027] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned method for efficient and intelligent identification of typical trees in a complex environment based on FPN are implemented.
[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for efficient and intelligent identification of typical trees in a complex environment based on FPN.
[0029] The beneficial effects of the present invention are as follows: the FPN-based efficient intelligent recognition method for typical trees in complex environments provided by the present invention effectively integrates feature information of different scales, thereby improving the recognition accuracy of typical trees, and accurately identifying tree species and locations even under complex environmental conditions. Compared with traditional manual detection, the FPN-based intelligent recognition technology can greatly improve the recognition efficiency. It can quickly process a large amount of image data and provide recognition results in real time, thereby reducing the workload and time cost of manual detection. In a complex natural environment, factors such as light changes, occlusion, and changing tree postures will bring difficulties to recognition. The FPN-based recognition technology can adapt to various complex environments, and by learning feature representations under different environments, improve the robustness and generalization ability of the model, thereby maintaining high recognition accuracy and efficiency under complex environments such as different lighting, weather and tree density. By integrating sensing equipment such as drones or cameras, the FPN-based intelligent recognition technology can realize real-time monitoring of trees in the transmission line corridor. This means that managers can understand the growth and distribution of trees in the corridor at any time and discover potential safety hazards in a timely manner. The real-time monitoring function can also help managers take measures such as pruning and felling in a timely manner to ensure the safe operation of the transmission line. In application scenarios such as transmission corridors, this technology can timely detect trees that may pose a threat to power facilities, providing strong support for risk warning and safety management. Through real-time monitoring and early warning, the risk of safety accidents caused by tree fall and branches touching the line can be reduced. FPN-based intelligent recognition technology can not only provide tree recognition results, but also extract key growth parameters such as tree height and crown diameter. These parameters can provide strong support for managers' decision-making. According to these parameters, scientific and reasonable vegetation management plans can be formulated, such as selecting suitable tree species and formulating pruning plans, so as to ensure the reasonable distribution and growth of vegetation in the transmission line corridor. Compared with traditional manual inspections, FPN-based intelligent recognition technology can greatly reduce operation and maintenance costs. It reduces the workload of manual inspections and greatly reduces labor costs; at the same time, it improves the efficiency and accuracy of recognition, and reduces the additional costs and losses caused by misjudgment or omissions. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0031] Figure 1 This is a flow chart of a method for efficiently and intelligently identifying typical trees in a complex environment based on FPN, provided as a first embodiment of the present invention.
[0032] Figure 2 A schematic diagram of a feature pyramid (FPN) of an efficient and intelligent method for identifying typical trees in a complex environment based on FPN provided in the first embodiment of the present invention.
[0033] Figure 3 A schematic diagram of the RetinaNet target detection algorithm of the FPN-based efficient intelligent recognition method for typical trees in complex environments provided in the first embodiment of the present invention.
[0034] Figure 4 A structural diagram of the attention mechanism of the FPN-based efficient and intelligent identification method for typical trees in complex environments provided in the first embodiment of the present invention.
[0035] Figure 5 This is a structural diagram of a highly efficient and intelligent identification system for typical trees in complex environments based on FPN provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0038] Example 1
[0039] Reference Figure 1 to Figure 4 , which is the first embodiment of the present invention, provides an efficient and intelligent method for identifying typical trees in complex environments based on FPN, including: collecting data on trees in transmission line corridors and preprocessing the collected data; building a feature pyramid network model and training the model; evaluating the trained model to identify typical trees in complex environments.
[0040] S1. Collect data on trees in the transmission line corridor and pre-process the collected data.
[0041] Data collection includes taking trees in the transmission line corridor as the target object, using drones equipped with high-definition cameras or fixed cameras to collect data in the transmission line corridor. The collected grayscale images cover different weather, lighting conditions and seasonal changes, and collect tree growth data; the pixel value in the grayscale image represents the brightness value. Tree growth data includes tree height and chest height.
[0042] Preprocessing includes image format unification and preliminary standardization, dynamic range adjustment and lighting enhancement, occlusion processing, data annotation and final data set construction.
[0043] Image format unification and preliminary standardization: convert all acquired images into a unified format and size, treat fixed pattern noise as image background noise, acquire original images, i.e. calibration images, in a completely dark environment, and in the subsequent normal image acquisition process, subtract each pixel value from the corresponding pixel value of the calibration image to eliminate fixed pattern noise.
[0044] Dynamic range adjustment and illumination enhancement, global adjustment of image contrast to compensate for the impact of illumination changes on image quality, expressed as:
[0045]
[0046] Where I′ is the contrast-adjusted image, I is the original image, min(I) is the minimum pixel value in the image, max(I) is the maximum pixel value in the image, and 255 is the maximum possible pixel value in an 8-bit image.
[0047] After contrast adjustment, the image is divided into multiple local areas. According to the brightness of the image, the brightness value is adjusted appropriately to keep the image constant when the illumination changes. The average brightness value of each local area is expressed as:
[0048]
[0049] Among them, L mean is the average brightness value of the local area, M is the number of rows in the local area, N is the number of columns in the local area, x is the x-th row in the local area, y is the y-th column in the local area, and I(x, y) is the brightness value of the image at (x, y).
[0050] For the average brightness value of each local area, if L mean If it is greater than the brightness threshold T of the local area, the local image brightness is reduced, which is expressed as:
[0051] I″(x,y)=I′(x,y)-|L mean -T|
[0052] Wherein, I′(x, y) is the image of the local area after contrast adjustment.
[0053] For the average brightness value of each local area, if L mean If it is less than the brightness threshold T of the local area, the local image brightness is increased, which is expressed as:
[0054] I″(x,y)=I′(x,y)+|L mean -T|
[0055] Where I″ is the image after brightness adjustment.
[0056] The brightness threshold of the local area is calculated in each local area using an adaptive threshold algorithm; the adaptive threshold algorithm includes an algorithm based on the neighborhood mean and an algorithm based on Gaussian weighting. For the algorithm based on the neighborhood mean, the threshold setting for each pixel is based on the average of the pixel values of its neighborhood (local area), and the average value (or weighted average value) of the pixels within a certain range around each pixel is calculated, and then the average value is fine-tuned as the threshold of the pixel, expressed as:
[0057] T = μ(x, y) - C
[0058] Among them, μ(x, y) is the average value of pixels, and C is the adjustment parameter.
[0059] For the Gaussian weighted algorithm, for areas in the image where the brightness changes slowly, the Gaussian function is used to weight the pixels around each pixel, and then the weighted average is calculated and fine-tuned as the threshold, which is expressed as:
[0060]
[0061] Among them, W(i, j) is the Gaussian weight, which decreases according to the distance from the center point, I(x+i, y+j) is the brightness value of the pixel in the neighborhood, and σ is the standard deviation of the Gaussian function, which controls the speed at which the weight decreases.
[0062] Occlusion processing, uses local feature enhancement to enhance the features of the occluded area in other unoccluded areas to compensate for the impact of occlusion recognition, expressed as,
[0063] I en (x, y)=I″(x, y)+α·(I″(x, y)-L mean )
[0064] Among them, I en (x, y) is the local image after local feature enhancement, and α is the enhancement coefficient; it controls the degree of enhancement and is usually between 0.5 and 1.5.
[0065] Perform data annotation and use image annotation tools (such as LabelImg or CVAT) to annotate the trees in the image. Before annotation, determine the annotation standards and rules, including location and category information (different types of trees), annotation format (bounding box, polygon, pixel-level annotation, etc.).
[0066] Bounding box annotation: For tree recognition tasks, bounding box annotation methods are usually used. Draw a rectangular box on the image to enclose the main part of the tree. The coordinates of the bounding box are usually expressed as the pixel coordinates of the upper left corner and the lower right corner.
[0067] Class annotation: Next to the bounding box or in the corresponding annotation file, you need to specify the class of the trees within the box. If there is only one tree class, you only need to annotate the bounding box; if there are multiple classes, you need to clearly annotate the class of each box. After the annotation is completed, ensure the accuracy and consistency of the annotation, and conduct multiple rounds of review and correction if necessary.
[0068] Dataset division: The labeled dataset is divided into two parts, most of which is used to train the model, a small part is used to verify the performance of the model during the training process, and the remaining data is used to finally evaluate the generalization ability of the model.
[0069] The annotated data is stored in an appropriate format, such as XML, JSON, or CSV files, which are usually stored together with the image files to facilitate subsequent model training and evaluation.
[0070] S2. Build a feature pyramid network model and train the model.
[0071] Use a pre-trained deep convolutional neural network (such as ResNet) as a feature extractor. The feature extractor performs convolution operations on the input image to generate feature maps at different levels. These feature maps have different spatial resolutions and semantic information, and can capture different scale information in the image.
[0072] FPN uses the different levels of feature maps generated by the feature extractor to build a feature pyramid through bottom-up, lateral connection and top-down methods. Figure 2 shown.
[0073] Building the FPN deep learning model:
[0074] Bottom-up path: From the bottom to the top of the VGG network, feature maps are gradually extracted, which will serve as the input of FPN from the bottom to the top.
[0075] Top-down path: Starting from the high layers of the VGG network, upsampling is used to gradually generate higher resolution feature maps that match the scale of the underlying features.
[0076] Horizontal connection: In a top-down process, low-level feature maps are combined with high-level feature maps to fuse spatial details and semantic information to form a feature pyramid.
[0077] Traditional FPN achieves feature fusion through simple upsampling and lateral connection, but in complex environments, this simple fusion method may not be enough to capture the subtle features of trees. Therefore, a more advanced feature fusion mechanism, such as the attention mechanism, is introduced here to enable the model to automatically learn and adjust the weights between features of different scales; in addition, a global context module is introduced to enhance the model's adaptability to complex environments, thereby improving the accuracy of tree recognition.
[0078] Introducing the attention mechanism: In each layer of the feature map in FPN, a channel attention mechanism is introduced to optimize the feature representation. Through steps such as global pooling, feature learning, feature fusion, and Sigmoid activation, an attention weight is generated for each channel. The generated attention weight is multiplied by each channel of the original feature map to obtain the attention-weighted feature map. This mechanism can adaptively adjust the weights between different channels, emphasizing useful feature channels for tree recognition while suppressing irrelevant or redundant channels. Figure 3 shown.
[0079] Introducing global context modules: Global context modules are introduced at different levels of FPN to capture multi-scale context information. This can be achieved by building a multi-scale feature fusion structure or using other context extraction techniques. The captured global context information is integrated with the feature map of FPN to enhance the model's understanding of complex environments.
[0080] On each layer of feature maps of FPN, the object detection algorithm is used to generate the bounding box of the tree. In order to quickly, efficiently and accurately detect tree scenes, especially in complex environments or when the tree sizes vary greatly, RetinaNet uses a dense object detector to detect objects. Figure 4 shown.
[0081] RetinaNet object detection algorithm: RetinaNet is a single-stage object detection algorithm designed to solve the imbalance problem between positive and negative samples. When combined with FPN, RetinaNet is able to generate anchor boxes on feature maps of multiple scales, which have different scales and aspect ratios to cover objects of different sizes. For each anchor box, the dense object detector predicts a category score (indicating whether there is an object in the anchor box and the category of the object) and a bounding box regression vector (used to adjust the position and size of the anchor box to fit the object more accurately). The FocalLoss loss function is used to solve the common problem of positive and negative sample imbalance in single-stage object detection algorithms.
[0082] After being processed by the dense object detector, a large number of predicted bounding boxes and corresponding category scores are obtained.
[0083] At each level of the feature pyramid, a detection head is applied to predict the class probability and bounding box coordinates of the target. For the bounding boxes output by each detection head, the non-maximum suppression (NMS) method is used to eliminate redundant bounding boxes for repeated detection of the same tree and retain the best prediction results. The specific steps include sorting, selecting the highest confidence box, calculating IoU, suppressing overlapping boxes, etc.
[0084] Non-maximum suppression (NMS): The main purpose of non-maximum suppression NMS is to select the best one from multiple overlapping candidate bounding boxes. In object detection, the model usually generates multiple bounding boxes that may contain the same target. NMS decides which bounding box should be retained by comparing the degree of overlap between bounding boxes (usually using the intersection and union ratio IoU metric) and the confidence of each bounding box, thereby removing redundant bounding boxes from these overlapping bounding boxes and retaining the best bounding box.
[0085] Step 1: First, according to the confidence of each border, all candidate edges are sorted in descending order, that is, the edge with the highest confidence is at the front.
[0086] Step 2: Create an empty list to store the bounding boxes that are finally retained.
[0087] Step 3: Pick the bounding box with the highest confidence and add it to the retained list.
[0088] Step 4: For the remaining bounding boxes, calculate their intersection over union (IoU) with the current best bounding box. If the IoU exceeds a preset threshold (such as 0.5), it is assumed that both boxes detect the same object, so the box with lower confidence is suppressed (i.e., discarded).
[0089] Step 5: Repeat steps 3 and 4 until all bounding boxes are checked. Each iteration selects the currently unprocessed box with the highest confidence as the best box, and suppresses other boxes that overlap with it by more than a threshold.
[0090] Step 6. Finally, all bounding boxes in the retained list will be output as detection results.
[0091] A deep learning model based on FPN is constructed. By combining feature maps of different network layers, the detection accuracy of tree targets is improved, so that the model can capture fine-grained (high-resolution) and coarse-grained (low-resolution) features of the image. In the target detection process, the appropriate feature layer is selected according to the size of the tree. Large trees use high-level features to capture semantics, and small trees use low-level features to retain details. In this way, the model can effectively use the feature pyramid network (FPN) to accurately detect and classify trees at multiple scales. The training of the model includes: the model uses labeled data to implement training, and the parameters of the model are updated through the back propagation algorithm, the training data is input into the network, the difference between the model output and the true label is calculated, and the value of the loss function is obtained. The gradient is calculated according to the loss function, the gradient of the output layer is propagated forward, and the gradient of each layer is calculated step by step until the gradient of the loss function of each parameter is calculated, and the model parameters are updated using the calculated gradient and the gradient descent optimization algorithm.
[0092] The model is initialized with pre-trained base network weights to accelerate convergence and improve performance. Multiple cycles of training are performed on the labeled dataset, each cycle includes forward propagation, loss function calculation, back propagation, and parameter update. The performance of the model on the validation set is also monitored, and training is stopped once the performance stops improving to avoid overfitting.
[0093] Loss function definition: In order to solve the problem of imbalance between positive and negative samples, the Focal Loss loss function is introduced here. The modulation factor is used to reduce the weight of easy-to-classify samples, so that the model pays more attention to difficult-to-classify samples during training, expressed as:
[0094] FL(p t )=-α t (1-p t ) γ log(p t )
[0095] Among them, FL(p t ) is the loss function, α t is the category weight (used to balance positive and negative samples), p t is the probability that the model predicts that the sample belongs to the true category, γ is the focusing parameter (used to control the weight of difficult and easy samples), and during the training process, for each sample, the model outputs a predicted probability p t , and then calculate the loss value according to the focal loss formula.
[0096] Training process: In each training batch, the labeled image data is sent to the RetinaNet model for forward propagation to obtain the prediction results. The Focal Loss loss function is used to calculate the difference between the prediction results and the actual labels to obtain the loss value. Through the back-propagation algorithm, the model parameters are updated according to the loss value to optimize the model performance. Repeat the above steps for multiple iterations until the model reaches a satisfactory performance state.
[0097] Training strategy: Optimizer selection: When training the FPN model, we chose Adam as the optimization algorithm to update the model parameters. Learning rate adjustment: Set an appropriate learning rate and use learning rate decay or learning rate warm-up strategies during training. Batch size: Determine the number of images used in each iteration, which usually requires a trade-off between computing resources and convergence speed. The Adam algorithm combines the characteristics of momentum and adaptive learning rate, which is suitable for deep learning tasks and can adaptively adjust the learning rate on different parameters. Use the torch.optim.Adam() function to create an Adam optimizer. Hyperparameters such as learning rate and weight decay can be set.
[0098] Learning rate warm-up strategy: In order to train the model more stably and avoid instability in the early stages of training, a learning rate warm-up strategy is adopted. Specifically, at the beginning of training, a smaller initial learning rate ηstart is selected. In the first few epochs of training, the learning rate is gradually increased until the set target learning ηend is reached. After the warm-up phase, regular training is performed using the set target learning rate. The learning rate warm-up strategy can effectively maintain the stability of model training and improve the convergence rate of the model, especially at the beginning of training.
[0099] Training loop: The model is trained using labeled data and the model parameters are updated through the back-propagation algorithm. Forward propagation: The training data is input into the network, and the difference between the model output and the true label is calculated to obtain the value of the loss function. Backward propagation: The gradient is calculated according to the loss function (i.e., the gradient of the loss function to the output layer), and the gradient of the output layer is propagated forward, calculating the gradient of each layer step by step until the gradient of the loss function of each parameter is calculated; using the calculated gradient, the model parameters are updated using optimization algorithms such as gradient descent.
[0100] The calculation process of back propagation can be expressed by the following mathematical formula:
[0101] Calculate the output layer gradient:
[0102]
[0103] Back propagating gradients:
[0104] δ(l)=((W(l+1))Tδ(l+1))⊙σ′(z(l))
[0105] Parameter update:
[0106] W(l)=W(l)-ηm1δ(l)(a(l-1))T
[0107] Parameter update:
[0108] b(l)=b(l)-ηm1∑i=1mδ(l)
[0109] Among them, δ(l) represents the error term of the first layer, W(l) and b(l) represent the weight and bias of the first layer respectively, η represents the learning rate, L represents the loss function, ⊙ represents element-by-element multiplication, and σ represents the derivative of the activation function.
[0110] Validation: Evaluate model performance on the validation set, monitoring loss and accuracy metrics.
[0111] Model adjustment: Adjust the model structure, hyperparameters, or training strategy based on the validation results.
[0112] Through the above methods, it is ensured that the FPN model can stably and effectively learn the feature information in the tree image during the training process, thereby achieving accurate detection of tree targets.
[0113] S3. Evaluate the trained model and identify typical trees in complex environments.
[0114] By calculating indicators such as accuracy, recall rate and F1 value, the trained model is verified and its performance is evaluated, and the model is optimized based on the evaluation results.
[0115] Accuracy refers to the ratio of the number of samples correctly predicted by the classifier as positive to the number of samples predicted by the classifier as positive. The calculation formula is as follows:
[0116] Precision=TP / (TP+FP)
[0117] Among them, TP stands for True Positive and FP stands for False Positive. TP indicates the number of positive samples successfully predicted by the model as positive samples, and FP indicates the number of negative samples incorrectly predicted by the model as positive samples.
[0118] Recall refers to the ratio of the number of samples correctly predicted by the classifier as positive to the number of samples in the true positive category. The calculation formula is as follows:
[0119] Recall=TP / (TP+FN)
[0120] Among them, TP stands for True Positive, and FN stands for False Negative. TP represents the number of positive samples that the model successfully predicts as positive, and FN represents the number of positive samples that the model incorrectly predicts as negative.
[0121] The F1 value is a comprehensive evaluation index of accuracy and recall, taking into account both the accuracy and recall of the model, and is particularly suitable for processing unbalanced data sets. The calculation formula is as follows:
[0122] F1=2×[(Precision×Recall) / (Precision+Recall)]
[0123] By calculating the accuracy, recall, and F1 value, the performance of the classification model can be more comprehensively evaluated.
[0124] Further optimization of the model based on the evaluation results may include adjusting the feature pyramid structure, adding regularization (such as Dropout), using more complex data augmentation strategies, etc.
[0125] In order to avoid the impact of noise on model recognition, reduce the model's over-reliance on training data, and thus improve the model's generalization ability, etc. This can be achieved by applying regularization techniques and adding penalty terms related to model complexity to the loss function, thereby helping the model improve its robustness to noise.
[0126] L1 regularization: By adding L1 normal constraints to the model parameters, some parameters tend to be sparse, thereby achieving the effect of feature selection. This helps to deal with the complexity of the model and helps to improve the generalization ability of the model.
[0127] L2 regularization: Also known as weight decay, it adds L2 norm constraints to model parameters to make them tend to smaller values, which helps reduce the complexity of the model to avoid overfitting. In deep learning, L2 regularization is often used in conjunction with weight decay, which is achieved by directly reducing weights during the gradient update process.
[0128] Dropout: During the training process, some neurons are randomly dropped so that the model faces a different network structure at each iteration. This method can reduce the correlation between neurons and reduce the model's dependence on specific neurons, thereby improving the model's generalization ability for unseen data.
[0129] The process of adjusting the feature pyramid structure involves multiple links, including the selection of the number of pyramid layers, the generation and fusion of feature maps, model design and training, and model evaluation and tuning. It is necessary to comprehensively consider the specific needs and actual conditions of the target detection or image segmentation tasks.
[0130] In addition, the model is optimized according to the hardware equipment and performance requirements in the actual environment, including model compression, quantization, acceleration and other technologies to improve the speed and performance of the model.
[0131] Example 2
[0132] Reference Figure 5 , which is the second embodiment of the present invention, is different from the previous embodiment in that it provides an efficient and intelligent recognition system for typical trees in complex environments based on FPN, including: a data acquisition and processing module, a model building module and a model evaluation module.
[0133] The data acquisition and processing module is used to collect data from trees in the transmission line corridor and pre-process the collected data.
[0134] The model building module is used to build a feature pyramid network model and train the model.
[0135] The model evaluation module is used to evaluate the trained model and identify typical trees in complex environments.
[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0137] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0138] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0139] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0140] Example 3
[0141] The third embodiment of the present invention is different from the first two embodiments in that it is used to verify the technical effects adopted in the present invention in order to verify the real effects of the method.
[0142] The method of the present invention:
[0143] Data collection: A drone equipped with a high-definition camera was used to collect 1,000 grayscale images in the transmission line corridor, covering different weather, lighting conditions and seasonal changes.
[0144] Data preprocessing: image format unification and standardization, dynamic range adjustment and lighting enhancement, occlusion processing, data annotation and construction of the final data set.
[0145] Model construction and training: Use the pre-trained deep convolutional neural network as a feature extractor to build a feature pyramid network model for training.
[0146] Model evaluation and optimization: Evaluate model performance through indicators such as accuracy, recall, and F1 value, and optimize the model based on the evaluation results.
[0147] Test environment: Model evaluation is performed using an independent test set containing images under different lighting, weather, and seasonal conditions.
[0148] Simulation conditions of traditional manual inspection method:
[0149] Data collection: Manual on-site inspections are carried out in the transmission line corridors to collect tree data.
[0150] Working hours: Assuming each working day is 8 hours, it is estimated that it will take 9 working days (about 72 hours) to complete the manual inspection of 1,000 images.
[0151] Environmental adaptability: Due to natural conditions such as weather and terrain, inspection efficiency may decrease due to bad weather or complex terrain.
[0152] Recognition accuracy: Due to human factors, the recognition accuracy is low and the misjudgment rate is high.
[0153] This embodiment uses the traditional method and our invented method to perform detection at the same time, and the detection comparison results are shown in the following table:
[0154] Table 1 Overall comparison table
[0155]
[0156] Through the above comparative data, it can be clearly seen that the method of the present invention has significant advantages in recognition accuracy, processing time, environmental adaptability, labor cost, coverage, real-time performance, misjudgment rate and maintenance cost. These advantages effectively improve the efficiency and accuracy of tree monitoring in transmission line corridors and help ensure the safe operation of transmission lines.
[0157] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An efficient and intelligent method for identifying typical trees in complex environments based on FPN, characterized by: include, Collect data on trees in the transmission line corridor and pre-process the collected data; Build a feature pyramid network model and train the model; The trained model is evaluated to identify typical trees in complex environments.
2. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 1, characterized in that: The data collection includes taking trees in the transmission line corridor as target objects, using drones equipped with high-definition cameras or fixed cameras to collect data in the transmission line corridor, the collected grayscale images covering different weather, light conditions and seasonal changes, and collecting tree growth data; The tree growth data includes the tree height and breast height of the tree.
3. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 2, characterized in that: The preprocessing of the collected data includes unification and preliminary standardization of image formats, dynamic range adjustment and illumination enhancement, occlusion processing, data annotation and final data set construction; The image format unification and preliminary standardization include converting all acquired images into a unified format and size, treating fixed pattern noise as image background noise, acquiring an original image, i.e., a calibration image, in a completely dark environment, and in a subsequent normal image acquisition process, subtracting each pixel value from a corresponding pixel value of the calibration image to eliminate the fixed pattern noise; The dynamic range adjustment and illumination enhancement include globally adjusting the image contrast to compensate for the effect of illumination changes on image quality, expressed as: Where I′ is the image after contrast adjustment, I is the original image, mmin(I) is the minimum pixel value in the image, and max(I) is the maximum pixel value in the image; After contrast adjustment, the image is divided into multiple local areas. According to the brightness of the image, the brightness value is adjusted appropriately to keep the image constant when the illumination changes. The average brightness value of each local area is expressed as, Among them, L mean is the average brightness value of the local area, M is the number of rows in the local area, N is the number of columns in the local area, x is the xth row in the local area, y is the yth column in the local area, and I(x, y) is the brightness value of the image at (x, y); For the average brightness value of each local area, if L mean If it is greater than the brightness threshold T of the local area, the local image brightness is reduced, which is expressed as: I″(x,y)=I′(x,y)-|L mean -T| Where I′(x, y) is the image of the local area after contrast adjustment; For the average brightness value of each local area, if L mean If it is less than the brightness threshold T of the local area, the local image brightness is increased, which is expressed as: I″(x,y)=I′(x,y)+|L mean -T| Where I″ is the image after brightness adjustment.
4. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 3, characterized in that: The brightness threshold of the local area is calculated in each local area using an adaptive threshold algorithm; The occlusion processing includes using local feature enhancement to enhance the features of the occluded area in other unoccluded areas. The feature representation is: I en (x,y)=I″(x,y)+α·(I″(x,y)-L mean ) Among them, I en (x, y) is the local image after local feature enhancement, and α is the enhancement coefficient.
5. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 4, characterized in that: The data annotation includes annotating the trees in the image using an image annotation tool. Before annotation, the annotation standards and rules are determined, including location and category information and the annotation format; For the tree recognition task, a bounding box annotation method is used to draw a rectangular box on the image to frame the main part of the tree. The coordinates of the bounding box are expressed as the pixel coordinates of the upper left corner and the lower right corner; In the bounding box or in the corresponding annotation file, specify the category of the trees in the box. If there is only one tree category, only the bounding box is annotated. If there are multiple categories, the category of each box needs to be clearly annotated. The final dataset construction includes allocating the preprocessed data into a training set, a validation set, and a test set in proportion.
6. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 5, characterized in that: The construction of the feature pyramid network model includes using a pre-trained deep convolutional neural network as a feature extractor, which performs a convolution operation on the input image to generate feature maps at different levels; The feature pyramid network model FPN uses the different levels of feature maps generated by the feature extractor to construct a feature pyramid through bottom-up, lateral connection and top-down methods; The bottom-up approach includes gradually extracting feature maps from the bottom layer to the top layer of the VGG network, and the feature maps are used as inputs of the FPN from the bottom layer to the top layer; The top-down approach includes starting from the high-level layer of the VGG network and gradually generating higher-resolution feature maps that match the underlying feature scale through upsampling; The lateral connection includes combining low-level feature maps with high-level feature maps in a top-down process to form a feature pyramid; In each layer of the feature map in FPN, a channel attention mechanism is introduced to optimize feature representation; The training of the model includes: the model is trained using labeled data, and the parameters of the model are updated through a back-propagation algorithm, the training data is input into the network, the difference between the model output and the true label is calculated to obtain the value of the loss function, the gradient is calculated according to the loss function, the gradient of the output layer is propagated forward, and the gradient of each layer is calculated until the gradient of the loss function of each parameter is calculated, and the model parameters are updated using the calculated gradient and a gradient descent optimization algorithm.
7. The FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in claim 6, characterized in that: The evaluation of the trained model includes verifying and evaluating the performance of the trained model by calculating the accuracy, recall rate and F1 value indicators, and optimizing the model according to the evaluation results; The optimizing the model includes adding regularization to optimize the model.
8. A system using the FPN-based efficient intelligent identification method for typical trees in complex environments as claimed in any one of claims 1 to 7, characterized in that: Including data acquisition and processing module, model building module and model evaluation module; The data acquisition and processing module is used to collect data from trees in the power transmission line corridor and pre-process the collected data; The model building module is used to build a feature pyramid network model and train the model; The model evaluation module is used to evaluate the trained model and identify typical trees in complex environments.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the FPN-based efficient and intelligent method for identifying typical trees in complex environments according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the FPN-based efficient and intelligent identification method for typical trees in complex environments according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Power transmission line defect recognition method based on improved RetinaNet network
CN110705374A
Target detection and classification method and computer readable storage medium
CN113887602A
Method for applying artificial intelligence identification technology to three-dimensional power transmission and transformation project measurement and calculation
CN114037836A
Improved new energy license plate detection and recognition method based on RetinaNet network
CN114170590A
Power transmission line foreign matter invasion identification method for dynamic feature supplement mechanism
CN115761537A
Cited By
Intelligent greenhouse with intelligent monitoring system and use method thereof
CN119336111A
