An adaptive scale-invariant feature clustering method for solar panel mask noise filtering
By using adaptive scale-invariant feature clustering and the FLANN algorithm, a template library is constructed to filter out noise in solar panel detection, solving the problem of noise affecting detection accuracy and achieving higher detection accuracy.
Patent Information
- Application Number
- CN202310422677.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-04-14
AI Technical Summary
Existing technologies have difficulty in effectively filtering out non-solar panel noise during solar panel detection, which affects the accuracy of detection results.
Adopting the adaptive scale-invariant feature clustering method, the template library is constructed and matched using the FLANN algorithm. By calculating the SIFT feature matrix and singular value decomposition, adaptive K-means clustering is performed and the threshold is set to filter the noise.
The accuracy of the detection results is improved, and it can be flexibly added to the existing algorithm process without changing the existing model structure, to correct the detection results and filter out noise from non-solar panels.
Smart Images

Figure CN116664897B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image detection, segmentation and noise filtering, and relates to an adaptive scale-invariant feature clustering solar panel mask noise filtering method. Background Art
[0002] As the promise of solar photovoltaic power generation continues to grow, its application has become more widespread than ever. In recent years, advances in solar technology have led to increasing efficiency of solar cells, decreasing costs of solar power generation, and a growing solar market. However, compared to traditional thermal power generation, solar power plants require the deployment of vastly larger clusters of solar panels across a region. As the number of solar panels in a single plant continues to increase, the cost of maintaining and overhauling the plant also increases, limiting the further expansion of photovoltaic power plants.
[0003] Drones are an effective inspection method that reduces manpower. Companies are now using drones to capture panoramic images of clustered solar panels and employ deep learning to detect the panels within these images for subsequent analysis. However, solar panel deployment varies widely, often occurring in complex terrain such as mountainous areas, water surfaces, and rooftops. Even within the same deployment area, a variety of sizes and types of panels may be deployed, depending on local conditions. Furthermore, aerial photography often results in irregular images of panels at an angle due to the terrain. Furthermore, lighting can affect image quality, resulting in poor quality. These factors present significant challenges for algorithms that extract solar panels.
[0004] Currently, deep learning is commonly used to extract solar panels from aerial panoramic images. To ensure both high accuracy and recall, a large amount of regional data must be collected and trained. However, this reduces the model's generalization capabilities and requires training multiple models for different regions, which is costly. To ensure only a high recall, the required data volume decreases, but the detection results often contain a large amount of noise, hindering subsequent detection and analysis. To reduce costs while still detecting as many solar panels as possible from an image, the current practice is to ensure a high recall. Therefore, in addition to solar panels, the detection results also include noise from vehicles, rooftops, and other sources, which impacts subsequent analysis and processing. Summary of the Invention
[0005] The technical problem to be solved by the present invention is how to filter out noise other than solar panel noise in a priori detection mask image to improve the accuracy of the detection result.
[0006] The present invention solves the above technical problems through the following technical solutions:
[0007] An adaptive scale-invariant feature clustering solar panel mask noise filtering method includes: a template library construction process and a template library matching process;
[0008] The process of constructing a template library includes the following steps:
[0009] S11. First, obtain all the prior detection masks from the prior detection mask image of the solar panel, calculate the SIFT features of all the prior detection masks, and combine all the SIFT feature vectors of the i-th mask into a feature matrix, recorded as A i , whose dimension is n×128;
[0010] S12. Give the dimension of the SIFT remap feature matrix of each mask, record the dimension as p×128, and then use the singular value decomposition of the matrix to transform A i Remap to A' i , A' i That is the SIFT remapping feature matrix;
[0011] S13, remap all SIFT features to matrix A' i Combine columns to form SIFT feature description matrix A';
[0012] S14, using the adaptive Kmeas algorithm to perform cluster analysis on the SIFT feature description matrix A';
[0013] S15. Get each SIFT remapping feature matrix A' i The category of each row vector of , count all row vector categories, and use the voting method to obtain the SIFT remapping feature matrix A' i Category C i ;
[0014] S16, remapping matrix A' based on the SIFT features of all masks i To divide the mask into m categories, and select the mask closest to the cluster center in the m categories as the typical mask. The number of typical masks is generally consistent with the number of clusters.
[0015] S17. Use typical masks to build a template library and calculate the SIFT feature remapping matrix A′ of each typical mask j ;
[0016] The template library matching process includes the following steps:
[0017] S21. For the mask set composed of all masks, calculate the SIFT feature remapping matrix A' of each mask i , and use the FLANN matching algorithm to match A' iSIFT feature remapping matrix A' with the typical mask in the template library j Match, record the number of matching points between the i-th mask and the j-th typical mask as Match ij .
[0018] S22, calculate the equivalent matching points R of the i-th template relative to all typical masks i ;
[0019] S23, setting a threshold of equivalent matching points. Masks below this threshold are assigned to the noise class, otherwise they are assigned to the solar panel class.
[0020] S24. Generate a filtered mask image according to the calculation result, thereby filtering out the noise in the prior detection mask.
[0021] Furthermore, the result of the singular value decomposition of the matrix described in step S12 is:
[0022] A i =U∑V * (1)
[0023] Among them, U is an n×n unitary matrix, ∑ is an n×128 non-negative real diagonal matrix, V is a 128×128 unitary matrix, V * Represents the conjugate transposed matrix of matrix V. By retaining the first m singular values, A can be i Remap to A' i .
[0024] Furthermore, all SIFT features are remapped into the matrix A' described in step S13. i The formula for combining the SIFT feature description matrix A' by column is as follows:
[0025]
[0026] Among them, A'1 represents the first element in the SIFT feature description matrix A', A' p Represents the pth element in the SIFT feature description matrix A'.
[0027] Furthermore, the process of clustering analysis of the SIFT feature description matrix A' using the adaptive Kmeas algorithm described in step S14 is as follows: each row of A' is regarded as a high-dimensional vector, K=2 is set, clustering is performed, and after clustering is completed, the CH value of the cluster is calculated, and the value of K is continuously increased for iteration until K grows to a preset threshold, and the clustering result with the largest CH value is selected.
[0028] Furthermore, the calculation formula of the CH value is as follows:
[0029]
[0030] The calculation formula of the intra-class distance matrix is as follows:
[0031]
[0032] The calculation formula of the inter-class distance matrix is as follows:
[0033]
[0034] Among them, tr() represents the sum operation of the diagonal elements of the matrix, W k is the intra-class distance matrix, B k is the inter-class distance matrix, n E Indicates the number of elements contained in class E, k means that a total of k categories are classified, C q Indicates the class of the current point, c q Represents the cluster center of the current class, c E represents the cluster center of class E, n q Indicates the number of elements contained in this class, n E Represents the number of elements contained in class E, x represents C q The elements of , q is the counting factor.
[0035] Furthermore, the voting method described in step S15 is used to obtain the SIFT remapping feature matrix A' i Category C i The formula is as follows:
[0036]
[0037] Among them, argmax{} is a function that finds parameters or sets of functions, Count() is a voting function, a q It's A' i The row vector of a q The corresponding clustering results.
[0038] Furthermore, the equivalent matching point number R of the i-th template relative to all typical masks is calculated in step S22. i The formula is as follows:
[0039]
[0040] Among them, c j is the type of typical mask j, Is type c j The number of all masks in , the result needs to be rounded up.
[0041] The advantages of the present invention are:
[0042] (1) The present invention first calculates the SIFT features of all prior detection masks and reduces their dimension into a feature matrix of fixed size; then, adaptive KMeans clustering is performed on all features, and the prior detection masks corresponding to the cluster centers are selected to construct a template library; then, the SIFT feature matrix of the constructed template library is used to estimate all prior detection masks based on the FLANN algorithm, and the prior detection masks with confidence levels lower than a threshold are marked as noise; finally, a filtered mask is constructed using all the prior detection mask estimation results; the present invention does not require any prior knowledge and can adaptively complete the filtering of any solar panel panoramic image detection mask. It can filter out non-solar panel noise in the detection results of the deep learning method without changing the existing model structure, thereby improving the accuracy of the detection results.
[0043] (2) The present invention is not coupled with the deep learning step in the detection process, and can be flexibly added to the existing algorithm process to ensure that the reconstruction risk is minimized when introducing additional detection processes. It can correct the results of any prior detection algorithm and ensure that the accuracy of the corrected results is not lower than the accuracy of the prior detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of the adaptive scale-invariant feature clustering solar panel mask noise filtering method of the present invention;
[0045] Figure 2 It is a flow chart of the template library construction process of the adaptive scale-invariant feature clustering solar panel mask noise filtering method of the present invention;
[0046] Figure 3 It is a flow chart of the template library matching process of the adaptive scale-invariant feature clustering solar panel mask noise filtering method of the present invention;
[0047] Figure 4 A panoramic view of the input for the present invention;
[0048] Figure 5 It is the prior detection mask of the input of the present invention. DETAILED DESCRIPTION
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0050] The technical solution of the present invention is further described below with reference to the accompanying drawings and specific embodiments:
[0051] Example 1
[0052] In this embodiment, an adaptive scale-invariant feature clustering solar panel mask noise filtering method uses scale-invariant feature transform (SIFT) and clustering to filter the solar panel prior detection results, such as Figure 1 The process shown is divided into building a template library and using the template library for matching. When building the template library, it is necessary to first calculate the SIFT feature matrix and feature remapping matrix of all masks, and then use the adaptive clustering algorithm to complete the calculation of the type of each mask, and select the masks near the center point of all clusters as typical templates to build a template library. At this time, the template library can be additionally fine-tuned to add or delete typical templates; then, matching is performed based on the constructed template library. It is necessary to first give the SIFT feature remapping matrix of the typical template, and use the FLANN algorithm to match the SIFT feature remapping matrix of each mask with the SIFT feature remapping matrix of the typical template to obtain the number of matching points and calculate the number of equivalent matching points. According to the set threshold, it is determined whether the mask is a solar panel, and finally a filtered mask is constructed.
[0053] Specifically, the following steps are included:
[0054] like Figure 4 and Figure 5 As shown, the input image format is first determined, where the panorama is an aerial panorama containing several solar panels, and the prior detection mask is a preliminary detection result using other algorithms, which contains a lot of noise.
[0055] 1. Build a template library
[0056] like Figure 2 As shown in the figure, the process of building a template library includes the following steps:
[0057] 1.1. Obtain all prior detection masks from the prior detection mask image of the solar panel and calculate the SIFT features of all prior detection masks. For the i-th mask, all its SIFT feature vectors can be combined into a feature matrix, denoted as A i , whose dimension is n×128.
[0058] 1.2. Given the dimension of the SIFT remap feature matrix of each mask, record the dimension as p×128, and then use the singular value decomposition of the matrix to transform A i Remap to A' i , A'i This is the SIFT remapping feature matrix. The purpose of this step is to make the SIFT feature matrix dimensions of each mask the same. If the number of singular values is insufficient during processing, the zero vector can be used as the missing SIFT remapping vector.
[0059] For A i ∈R n×128 For a matrix (n>128), the singular value decomposition result is:
[0060] A i =U∑V * (1)
[0061] Among them, U is an n×n unitary matrix, ∑ is an n×128 non-negative real diagonal matrix, and V is a 128×128 unitary matrix. By retaining the first m singular values, A can be i Remap to A' i ;
[0062] In addition to using singular value decomposition for dimensionality reduction, you can also directly take A i The first m rows of are used for remapping. There are many ways to remap. We only need to ensure that the final A' i The dimensions are consistent.
[0063] 1.3. Remap all SIFT features into matrix A' i Combine columns to form SIFT feature description matrix A';
[0064]
[0065] Among them, A'1 represents the first element in the SIFT feature description matrix A', A' p Represents the pth element in the SIFT feature description matrix A'.
[0066] 1.4. Use the adaptive Kmeas algorithm to perform cluster analysis on the SIFT feature description matrix A'. Specifically, treat each row of A' as a high-dimensional vector, set K = 2, and perform clustering. After clustering is complete, calculate the CH value of the cluster. A larger CH value indicates a better clustering effect. Continue to increase the value of K and iterate until K reaches a preset threshold. Then select the clustering result with the largest CH value.
[0067]
[0068]
[0069]
[0070] The calculation of CH value is shown in formula (3), Bk is the inter-class distance matrix, W k is the intra-class distance matrix. k The calculation of is shown in formula (4), where k means that the total number of categories is k, C q Indicates the class of the current point, c q Indicates the cluster center of the current class. B k The calculation of is shown in formula (5), where c E represents the cluster center of class E, n q Indicates the number of elements contained in this class, n E Represents the number of elements contained in class E, x represents C q The elements of , q is the counting factor.
[0071] During the application process, an upper bound can be set for the K value to reduce unnecessary calculations.
[0072] 1.5. Each SIFT remapping feature matrix A' can be obtained through the adaptive Kmeans algorithm i The category of each row vector of , count all row vector categories, and use the voting method to obtain the SIFT remapping feature matrix A' i The category is denoted as C i ;
[0073]
[0074] Among them, argmax{} is a function that finds parameters or sets of functions, Count() is a voting function, a q It's A' i The row vector of a q The corresponding clustering results.
[0075] At this time, A' i The clusters to which each row vector belongs are not necessarily completely consistent, but it can ensure that the clustering results of most row vectors are the same. In addition, it is possible that the clusters calculated by adaptive Kmeans are 5 categories, but A' i There are fewer than 5 categories, which is the local error correction capability reflected by the voting method.
[0076] 1.6. Remapping matrix A' based on the SIFT features of all masks i To divide these masks into m classes, and select the mask closest to the cluster center in these classes as the typical mask. The number of typical masks is generally consistent with the number of clusters, but not necessarily exactly the same.
[0077] 1.7. Use these typical masks to build a template library and calculate the SIFT feature remapping matrix A' of each typical mask jAt this time, when constructing the template library, the selected typical templates can be added, deleted, modified, and morphologically transformed to increase the effect of subsequent matching.
[0078] 2. Template library matching
[0079] like Figure 3 As shown, the template library matching process includes the following steps:
[0080] 2.1. For the mask set composed of all masks, calculate the SIFT feature remapping matrix A' of each mask i , and use the FLANN matching algorithm to match A' i SIFT feature remapping matrix A' with the typical mask in the template library j Match, record the number of matching points between the i-th mask and the j-th typical mask as Match ij .
[0081] 2.2. Calculate the equivalent matching points R of the i-th template relative to all typical masks i ;
[0082]
[0083] where c j is the type of typical mask j, Is type c j The number of all masks in , the result needs to be rounded up.
[0084] 2.3. Set a threshold for the number of equivalent matching points. Masks below this threshold are assigned to the noise class, otherwise they are assigned to the solar panel class. This hyperparameter can be adjusted as needed.
[0085] 2.4. Based on the above calculation results, a filtered mask image can be generated to filter out the noise in the prior detection mask. At this time, a mask image with the same Figure 5 Similar filtered mask.
[0086] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An adaptive scale-invariant feature clustering solar panel mask noise filtering method, characterized by: include: Template library construction process and template library matching process; The process of constructing a template library includes the following steps: S11, first obtain all the prior detection masks from the prior detection mask image of the solar panel, and calculate the SIFT features of all the prior detection masks, and then All SIFT feature vectors of the mask are combined into a feature matrix, recorded as , whose dimensions are ; S12. Give the dimension of the SIFT remap feature matrix of each mask, and record the dimension as , and then use the singular value decomposition of the matrix to Remap to , That is the SIFT remapping feature matrix; S13, remap all SIFT features to matrix Combine columns to form SIFT feature description matrix ; S14, using the adaptive Kmeas algorithm to describe the SIFT feature matrix The specific process of cluster analysis is as follows: Each row of is considered as a high-dimensional vector, and K=2 is set to perform clustering. After clustering is completed, the CH value of the cluster is calculated. The value of K is continuously increased and iterated until K reaches the preset threshold, and the clustering result with the largest CH value is selected. The calculation formula of the CH value is as follows: The calculation formula of the intra-class distance matrix is as follows: The calculation formula of the inter-class distance matrix is as follows: Among them, tr() represents the sum operation of the diagonal elements of the matrix, is the intra-class distance matrix, is the inter-class distance matrix, Indicates the number of elements contained in class E, Indicates that the total number of kind, Indicates the class of the current point. Represents the cluster center of the current class, Representation Class The cluster center of Indicates the number of elements contained in this class. Indicates the number of elements contained in class E, express Elements of , q is the counting factor; S15. Get each SIFT remapping feature matrix The category of each row vector of , count all row vector categories, and use the voting method to obtain the SIFT remapping feature matrix Category ; S16, SIFT feature remapping matrix based on all masks To divide the mask into class, and in The mask closest to the cluster center is selected as the typical mask in the class, and the number of typical masks is generally consistent with the number of clusters; S17. Use typical masks to build a template library and calculate the SIFT feature remapping matrix of each typical mask ; The template library matching process includes the following steps: S21. For the mask set composed of all masks, calculate the SIFT feature remapping matrix of each mask , and use the FLANN matching algorithm to SIFT feature remapping matrix with typical masks in the template library Match, remember The mask and The number of matching points of a typical mask is ; S22, calculate the The number of equivalent matching points of a template relative to all typical masks ; S23, setting a threshold of equivalent matching points. Masks below this threshold are assigned to the noise class, otherwise they are assigned to the solar panel class. S24. Generate a filtered mask image according to the calculation result, thereby filtering out the noise in the prior detection mask.
2. The method for filtering solar panel mask noise using adaptive scale-invariant feature clustering according to claim 1, characterized in that: The result of the singular value decomposition of the matrix described in step S12 is: in, for A unitary matrix of order , yes A non-negative real diagonal matrix of yes Unitary matrix of order, Representation matrix The conjugate transposed matrix of Remap to .
3. The method for filtering solar panel mask noise using adaptive scale-invariant feature clustering according to claim 2, characterized in that: All SIFT features are remapped into matrices as described in step S13 Combine columns to form SIFT feature description matrix The formula is as follows: in, 1 represents the SIFT feature description matrix The first element in p Represents the SIFT feature description matrix The pth element in .
4. The method for filtering solar panel mask noise using adaptive scale-invariant feature clustering according to claim 3, characterized in that: The SIFT remapping feature matrix is obtained by using the voting method described in step S15 Category The formula is as follows: Among them, argmax{} is a function that finds parameters or sets of functions, and Count() is a voting function. yes The row vector of yes The corresponding clustering results.
5. The method for filtering solar panel mask noise using adaptive scale-invariant feature clustering according to claim 4, characterized in that: The calculation of step S22 is described The number of equivalent matching points of a template relative to all typical masks The formula is as follows: in, A typical mask Type, is type The number of all masks in , the result needs to be rounded up.
Citation Information
Patent Citations
Method for detecting contour of casting box in noise environment
CN111292346A
Identifying versions of a form
US20180181808A1