SAM model-based tree species data high-robustness automatic labeling method and system
By using the multi-scale feature fusion method of SAM model in automatic tree image annotation, feature extraction and weights are dynamically adjusted, and the recognition accuracy problem under different seasons and lighting conditions is solved, and efficient and robust tree image annotation is achieved.
Patent Information
- Application Number
- CN202411150991.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-10
AI Technical Summary
In the automatic labeling of tree species images, it is difficult to maintain high accuracy and robustness in different seasons and lighting conditions, especially in complex environments, the recognition effect is poor.
Using a multi-scale feature fusion method based on SAM model, features are extracted through multi-level convolutional layers, and the response intensity of the filter is dynamically adjusted using the quaternary adjustment function, combining the feature fusion layer and the decision-making layer, and dynamically adjusting the features according to seasons and lighting conditions. Weight, improve the adaptability of image recognition.
It significantly improves the accuracy and robustness of automatic labeling of tree species images, and can maintain efficient and reliable labeling performance in a variable natural environment.
Smart Images

Figure CN119295868A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a highly robust automatic labeling method and system for tree species data based on a SAM model. Background Art
[0002] In ecological and botanical research, the identification and classification of tree species is a basic and critical task, which has a great impact on biodiversity conservation, forest management and ecosystem health assessment. Traditional tree species identification relies on the experience and knowledge of experts, which is not only time-consuming and costly, but also has limitations in its application in large-scale or remote areas.
[0003] With the advancement of technology, especially in the fields of computer vision and artificial intelligence, image recognition technology has been widely used to automatically identify and classify plant species. This method relies on digital features extracted from tree species images to automatically identify tree species. Although this technology has made significant progress, it still faces some challenges in practical application scenarios with large environmental changes, such as image recognition accuracy in different seasons, different lighting conditions, and different viewing angles.
[0004] Traditional image recognition methods often rely on feature extraction at a single scale, which often makes it difficult to obtain satisfactory recognition results when processing images with complex backgrounds or changing environments. In order to improve recognition accuracy and system robustness, researchers have begun to explore the use of multi-scale feature extraction methods. This method can extract features from both small scales (such as leaf texture) and large scales (such as overall shape and contour) at the same time. By comprehensively considering information at multiple scales, the system can understand the image content more comprehensively, thereby improving recognition accuracy under various environmental conditions.
[0005] In addition, with the development of deep learning technology, especially the successful application of convolutional neural networks (CNN) in the field of image processing, deep learning-based automatic tree species labeling methods have become possible. These methods can automatically extract complex features and perform effective classification by learning a large amount of labeled image data, significantly improving processing speed and accuracy. However, how to design a highly robust model that can adapt to different seasonal changes and cope with different lighting conditions is still one of the main challenges facing this field. Summary of the invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is to improve the accuracy and robustness of automatic annotation of tree species images, especially the adaptability and performance in the face of different seasons, lighting conditions and changes in viewing angles.
[0008] To solve the above technical problems, the present invention provides the following technical solution: a highly robust automatic labeling method for tree species data based on the SAM model, which comprises the following steps:
[0009] Collect image data of tree species and preprocess them; manually annotate the preprocessed image data; build a SAM model and train the SAM model with the annotated image data; input the tree species images to be annotated into the SAM model; and automatically evaluate the annotation results using pre-defined indicators.
[0010] As a preferred solution of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, the image data of the tree species are image data of different seasons, different lighting conditions and different angles.
[0011] The preprocessing includes removing noise data and repeated data from the image data.
[0012] As a preferred solution of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, the construction of the SAM model includes using a multi-level convolutional layer to extract features in the tree species image, adding a fusion feature strategy to the SAM model, and fusing features extracted at different scales.
[0013] The multi-level convolutional layer includes an initial convolutional layer, a multi-scale convolutional layer, a feature fusion layer and a decision layer.
[0014] The different scales include small scale, medium scale and large scale.
[0015] As a preferred solution of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, wherein: the training of the SAM model and the evaluation of the SAM model performance include dividing the labeled tree species image data into a training set, a validation set and a test set, training the SAM model through the training set, monitoring the SAM model performance through the validation set, and evaluating the SAM model through the test set.
[0016] As a preferred solution of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, wherein: the inputting of the tree species image to be labeled into the SAM model includes extracting the tree species image data to be labeled according to the initial convolutional layer, wherein the tree species image data includes the changes in leaves in spring, summer, autumn and winter, as well as strong and weak light.
[0017] The light intensity refers to that the average brightness is higher than the first-level threshold, and the light weakness refers to that the average brightness is lower than the second-level threshold.
[0018] The multi-scale convolution layer dynamically adjusts the response strength of the filter through a seasonal light adjustment function, and the response strength includes a scale factor and an offset.
[0019] The seasonal light adjustment function is expressed as:
[0020] γ(c)=γ0×(1+f(s,l))
[0021] β(c)=β0+g(s,l)
[0022] Among them, γ(c) represents the scale factor, β(c) represents the offset, γ0 represents the baseline scale parameter, β0 represents the baseline offset parameter, f(s,l) is the subsidiary function for adjusting the scale factor, and g(s,l) is the subsidiary function for adjusting the offset.
[0023] The subsidiary function of the adjustment scale factor is expressed as,
[0024] f(s,l)=a s +b l +d sl ·(s∧l)
[0025] The auxiliary function of adjusting the offset is expressed as,
[0026] g(s,l)=α s +β l +δ sl ·(s∧l)
[0027] The a s represents the adjustment coefficient for season s, b l Indicates the adjustment coefficient of light l, d sl represents the interaction adjustment coefficient between season s and light l, δ sl represents the interaction effect coefficient between season s and light l, α s represents the basic offset of season s, β l Represents the basic offset of the illumination l, and ∧ represents the logical AND.
[0028] As a preferred scheme of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, the dynamic adjustment of the response intensity of the filter includes: when it is spring and the light is strong, increasing the proportional factor, increasing the offset, f(s,l) and g(s,l) are respectively positive; when it is spring and the light is weak, increasing the proportional factor, reducing the offset, f(s,l) is positive, and g(s,l) is negative.
[0029] When it is summer and the light is strong, the scale factor and offset are reduced, and f(s,l) and g(s,l) are negative respectively. When it is summer and the light is weak, the scale factor is reduced, f(s,l) is negative, the offset is increased, and g(s,l) is positive.
[0030] When it is autumn, the scale factor and offset are increased, and f(s,l) and g(s,l) are positive.
[0031] When it is winter and the light is strong, the scale factor and offset are reduced, and f(s,l) and g(s,l) are negative. When it is winter and the light is weak, the scale factor is reduced and the offset is increased, and f(s,l) is negative and g(s,l) is positive.
[0032] The feature fusion layer applies different fusion strategies according to the light intensity and season. When there is no light influence in a specific season, the small-scale weight W sml is 0.3, and the mid-scale weight W med is 0.4, and the large-scale weight W lar is 0.3.
[0033] Defining ΔW s (s, l), ΔW m (s, l), ΔW l (s, l) is the adjustment factor based on season s and light l. The small-scale weight, medium-scale weight and large-scale weight affected by season s and light l are expressed as,
[0034] W s (S, H) = W s (s, l)+ΔW s (s, l)
[0035] W m (S, H) = W m (s, l)+ΔW m (s, l)
[0036] W l (S, H)==W l (s, l)+ΔW l (s, l)
[0037] When it is spring and the light is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive.
[0038] When it is spring and the light is weak, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative.
[0039] When it is summer and the light is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l(s, l) is positive.
[0040] When it is summer and the light is weak, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative.
[0041] In autumn, ΔW s (s, l) = 0, ΔW m (s, l) is positive, ΔW l (s, l) is negative.
[0042] When it is winter and the light intensity is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive.
[0043] When it is winter and the light is weak, ΔW s (s, l) is negative, ΔW m (s, l) is negative, ΔW l (s, l) is positive.
[0044] The decision layer outputs the labeling result of each input tree species image data according to the fused features.
[0045] The labeling result is a tree species category.
[0046] As a preferred solution of the highly robust automatic labeling method for tree species data based on the SAM model described in the present invention, the automatic evaluation of labeling results through pre-determined indicators includes manually reviewing the number of tree species incorrectly labeled by the SAM model, obtaining the accuracy of the automatic evaluation labeling results, listing the accuracy rates of different tree species, and when there are tree species with an accuracy rate less than or equal to 95%, expanding the training samples of the corresponding tree species.
[0047] Another object of the present invention is to provide a highly robust automatic labeling system for tree species data based on the SAM model, which can solve the problems of low accuracy and adaptability of the prior art in dealing with changing environmental conditions (such as different seasons and light changes) by dynamically adjusting feature fusion strategies and adaptive feature extraction mechanisms.
[0048] To solve the above technical problems, the present invention provides the following technical solutions: a highly robust automatic labeling system for tree species data based on the SAM model, including a data acquisition and preprocessing module, a model building and training module, a feature fusion and decision module, and a performance evaluation module.
[0049] The data collection and preprocessing module is responsible for collecting tree species image data and processing the collected image data.
[0050] The model building and training module is responsible for building the SAM model and training the SAM model.
[0051] The feature fusion and decision module dynamically adjusts the feature weights of different scales in the feature fusion layer according to the changes in light intensity and seasons, and outputs the tree species labeling result of each input image according to the fused features, that is, classifies each image into a specific tree species category.
[0052] The performance evaluation module automatically evaluates the quality of the annotation results through pre-set performance indicators.
[0053] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the highly robust automatic labeling method for tree species data based on the SAM model as described above are implemented.
[0054] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the highly robust automatic labeling method for tree species data based on the SAM model as described above.
[0055] Beneficial effects of the present invention: The present invention significantly improves the accuracy and robustness of automatic annotation of tree species images by adopting a multi-scale SAM model. By combining dynamic feature adjustment and multi-scale feature fusion technology, the present invention can effectively adapt to various seasonal changes and lighting conditions, thereby ensuring efficient and reliable annotation performance in a changing natural environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] 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 work.
[0057] Figure 1 The overall flow chart of the highly robust automatic labeling method for tree species data based on the SAM model provided in the first embodiment of the present invention.
[0058] Figure 2 The overall framework diagram of the highly robust automatic annotation system for tree species data based on the SAM model provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the above-mentioned purposes, 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 drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0060] Example 1, reference Figure 1 , which is an embodiment of the present invention, provides a highly robust automatic labeling method for tree species data based on the SAM model, characterized in that:
[0061] S1: Collect image data of tree species and preprocess them, and label the preprocessed image data.
[0062] The image data of tree species are image data of different seasons, different lighting conditions and different angles.
[0063] Preprocessing includes removing noise data and duplicate data from image data.
[0064] S2: Build a SAM model and train the SAM model using the labeled image data.
[0065] The construction of the SAM model includes using a multi-level convolutional layer to extract features from tree species images, adding a fusion feature strategy to the SAM model to fuse features extracted at different scales;
[0066] The multi-level convolutional layer includes the initial convolutional layer, the multi-scale convolutional layer, the feature fusion layer and the decision layer.
[0067] Different scales include small scale, medium scale and large scale.
[0068] In the present invention, the small scale is 3×3, the medium scale is 5×5, and the large scale is 9×9.
[0069] Training the SAM model and evaluating the performance of the SAM model include dividing the labeled tree species image data into a training set, a validation set, and a test set, training the SAM model through the training set, monitoring the performance of the SAM model through the validation set, and evaluating the SAM model through the test set.
[0070] S3: Input the tree species image to be labeled into the SAM model.
[0071] Inputting the tree species image to be labeled into the SAM model includes extracting the tree species image data to be labeled according to the initial convolution layer, wherein the tree species image data includes the changes of leaves in spring, summer, autumn and winter, as well as strong and weak light.
[0072] The changes in leaves in spring, summer, autumn and winter include:
[0073] Spring: Trees begin to bud and new leaves and flowers appear, features that often appear as bright greens and other vibrant colors in images.
[0074] Summer: With lush, dark green leaves, trees are typically at their most lush during this season, which can help the model identify typical maturity characteristics.
[0075] Autumn: Leaves change color dramatically, shifting from green to yellow, orange, or red. These color changes are prominent features of autumn images and are important for identifying seasonal changes.
[0076] Winter: Many tree species lose their leaves, leaving only branches, which can make identification more difficult due to the lack of typical leaf green color and leaf structure.
[0077] Strong light refers to the average brightness being higher than the first-level threshold, and weak light refers to the average brightness being lower than the second-level threshold.
[0078] The first-level threshold of the present invention is 200 lux, and the second-level threshold is 100 lux.
[0079] The multi-scale convolution layer dynamically adjusts the response strength of the filter through the seasonal light adjustment function, and the response strength includes the scale factor and the offset.
[0080] The seasonal light adjustment function is expressed as,
[0081] γ(c)=γ0×(1+f(s,l))
[0082] β(c)=β0+g(s,l)
[0083] Among them, γ(c) represents the scale factor, β(c) represents the offset, γ0 represents the baseline scale parameter, β0 represents the baseline offset parameter, f(s,l) is the subsidiary function for adjusting the scale factor, and g(s,l) is the subsidiary function for adjusting the offset.
[0084] The subsidiary function for adjusting the scale factor is expressed as,
[0085] f(s,l)=a s +b l +d sl ·(s∧l)
[0086] The subsidiary function for adjusting the offset is expressed as,
[0087] g(s,l)=α s +β l +δ sl ·(s∧l)
[0088] a s represents the adjustment coefficient for season s, b l Indicates the adjustment coefficient of light l, d sl represents the interaction adjustment coefficient between season s and light l, δ sl represents the interaction effect coefficient between season s and light l, α s represents the basic offset of season s, β l Represents the basic offset of the illumination l, and ∧ represents the logical AND.
[0089] Dynamically adjusting the response strength of the filter includes, when it is spring and the light is strong, increasing the scale factor, increasing the offset, f(s,l) and g(s,l) are positive respectively, f(s,l) is positive and used to enhance the model's sensitivity to the details of new leaves and flowers, because these details may be lost due to overexposure when the light is strong in spring, g(s,l) is positive and used to increase color saturation and contrast, helping the model capture delicate color changes and features under strong light, and when it is spring and the light is weak, increasing the scale factor and reducing the offset, f(s,l) is positive and g(s,l) is negative. The reason for increasing the scale factor is the same as above, and g(s,l) is negative to adjust the brightness and contrast to avoid the image appearing too dark in low light conditions.
[0090] In spring, for f(s,l), its parameter is adjusted to a s Increase, used to improve the model's sensitivity to new leaves and flowers, b l The adjustment is to slightly reduce the light intensity under strong lighting conditions and slightly increase the light intensity under weak lighting conditions to adapt to the capture of details under different lighting conditions. sl The adjustment is to reduce the effect of this item for the combination of spring and strong light, because it is necessary to suppress the overexposure effect; for spring and weak light, increase this item to enhance the details. For g(s,l), its parameters are adjusted to, α s Increased to match the changing colors and new growth characteristics of spring, β l When the light is strong, it is reduced to control overexposure and maintain natural colors. When the light is weak, it is increased to improve the brightness and clarity of the image and help identify details. sl In spring, when the light is strong, reduce it to avoid oversaturation of colors under strong light. In spring, when the light is weak, increase it to enhance color contrast to compensate for insufficient light.
[0091] When it is summer and the light is strong, the scale factor and offset are reduced, and f(s,l) and g(s,l) are negative. The reason for taking f(s,l) as negative is that the vegetation is lush in summer, and we focus on the large-scale vegetation structure rather than the details. The reason for taking g(s,l) as negative is to reduce the brightness and contrast to avoid overexposure and color distortion caused by strong light. When it is summer and the light is weak, the scale factor is reduced, f(s,l) is negative, and the reason is the same as above. The offset is increased, and g(s,l) is positive to increase the brightness and contrast to compensate for the lack of light.
[0092] In summer, for f(s,l), the parameter is adjusted to a s Lower because the focus is on mature leaves and lush crowns rather than emerging details. l The adjustment is to reduce the brightness in strong light conditions to avoid overexposure, and increase the brightness in weak light conditions to enhance the visual effect in darker environments. sl The adjustment is to significantly reduce the combination of summer and strong light, and increase it appropriately for summer and weak light.
[0093] For g(s,l), its parameters are adjusted to, α s Lower, as summer is mainly characterized by extensive green coverage, requiring less color adjustment. l When the light is strong, it is significantly reduced to prevent overexposure and color distortion of the image. When the light is weak, it is appropriately increased to improve the visual quality of the image. sl In summer, when the light is strong, it will be significantly reduced to reduce the adjustment of color saturation. In summer, when the light is weak, it will be appropriately increased to enhance the model's ability to capture details.
[0094] When it is autumn, the scale factor and offset are increased, and f(s,l) and g(s,l) are positive. The reason is that the colors of autumn leaves vary greatly, and the model's sensitivity to colors and details needs to be enhanced, and the color saturation and contrast need to be strengthened to highlight the rich autumn colors.
[0095] In autumn, for f(s,l), its parameter is adjusted to a s Increase, especially to strengthen the model's ability to handle changing colors. l The adjustment is to increase the light intensity to highlight the rich autumn colors; and increase the light intensity to ensure that the color changes can still be clearly captured when the light is insufficient. sl For autumn and strong or low light combinations, both should be increased to adapt to the characteristics of autumn color changes.
[0096] For g(s,l), α s Significant increase, as autumn color changes are a key feature and the model needs to be adjusted to capture these changes. lIncreased in bright light conditions to better showcase the richness of fall colors. Increased in dim light conditions to ensure rich colors can still be identified in low light conditions. sl In autumn, when the light is strong or weak, the adjustment of color contrast and saturation should be increased.
[0097] When it is winter and the light is strong, the scale factor and offset are reduced, and f(s,l) and g(s,l) are negative. f(s,l) is negative because most trees lose their leaves in winter, and the focus is on the branches and overall shape. g(s,l) is negative because the brightness and contrast are reduced to avoid overexposure of exposed branches under strong light. When it is winter and the light is weak, the scale factor is reduced and the offset is increased, and f(s,l) is negative and g(s,l) is positive. f(s,l) is negative because even in poor lighting conditions, the focus is on the branches and overall shape of the tree. g(s,l) is positive because the brightness and contrast are increased to help identify the structure of trees in winter environments with insufficient light.
[0098] In winter, for f(s,l), its parameter is adjusted to a s Lower, because it is mainly leafless branches with less detail. l The adjustment is to reduce the light intensity to prevent overexposure of bare branches and increase the light intensity to ensure that branches can be identified in low light conditions. sl For the combination of winter and strong light, it is significantly reduced; for winter and weak light, it is appropriately increased.
[0099] For g(s,l), α s Lower, as winter is mainly characterized by lack of color in branches and withered vegetation. l Reduce when the light is strong to reduce the brightness of the image and prevent bare branches from being overexposed. Increase when the light is weak to increase the image brightness and help identify the outline of trees in dim environments. sl In winter, when the light is strong, lower it to reduce the adjustment of brightness and contrast. In winter, when the light is weak, increase it to enhance the visibility and clarity of the image.
[0100] The feature fusion layer applies different fusion strategies according to the light intensity and season. When there is no light influence in a specific season, the small-scale weight W s (s, l) is 0.3, and the mid-scale weight W m (s, l) is 0.4, and the large-scale weight W l (s, l) is 0.3.
[0101] Defining ΔW s (s, l), ΔW m (s, l), ΔW l(s, l) is the adjustment factor based on season s and light l. The small-scale weight, medium-scale weight and large-scale weight affected by season s and light l are expressed as,
[0102] W s (S, H) = W s (s, l)+ΔW s (s, l)
[0103] W m (S, H) = W m (s, l)+ΔW m (s, l)
[0104] W l (S, H)==W l (s, l)+ΔW l (s, l)
[0105] When it is spring and the light is strong, the small-scale weight is reduced and the large-scale weight is increased, because strong light may cause small-scale features to be overexposed, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive.
[0106] In spring and when the light is weak, increase the small-scale weights and appropriately reduce the large-scale weights to capture more details, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative.
[0107] When it is summer and the light is strong, ΔW is the same as in spring. s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive.
[0108] When it is summer and the light is weak, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative.
[0109] In autumn, due to the rich color changes in autumn, the mesoscale weight is increased to better capture the color and structure, ΔW s (s, l) = 0, ΔW m (s, l) is positive, ΔW l (s, l) is negative.
[0110] When it is winter and the light is strong, the large-scale weight is increased to deal with the high contrast situation, ΔWs (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive.
[0111] When it is winter and the light is weak, the large-scale weight is significantly increased because more global information is needed when the light is insufficient, ΔW s (s, l) is negative, ΔW m (s, l) is negative, ΔW l (s, l) is positive.
[0112] The decision layer outputs the labeling results of each input tree species image data based on the fused features.
[0113] The labeling results are tree species categories.
[0114] In the present invention, when there is no illumination influence in a specific season, the small-scale weight W sml is 0.3, and the mid-scale weight W med is 0.4, and the large-scale weight W lar is 0.3.
[0115] When it is spring and the light is strong, ΔW s (s, l) = -0.1, ΔW m (s, l) = 0, ΔW l (s, l) = 0.1, small scale weight W s (S, H) is changed to 0.2, the mid-scale weight W m (S, H) is changed to 0.4, and the large scale weight W l (S, H) was changed to 0.4.
[0116] When it is spring and the light is weak, ΔW s (s, l) = 0.1, ΔW m (s, l) = 0, ΔW l (s, l) = -0.1, small scale weight W s (S, H) is changed to 0.4, the mid-scale weight W m (S, H) is changed to 0.4, and the large scale weight W l (S, H) was changed to 0.2.
[0117] When it is summer and the light is strong, ΔW s (s, l) = -0.1, ΔW m (s, l) = 0, ΔW l (s, l) = 0.1, small scale weight W s (S, H) is changed to 0.2, the mid-scale weight W m (S, H) is changed to 0.4, and the large scale weight Wl (S, H) was changed to 0.4.
[0118] When it is summer and the light is weak, ΔW s (s, l) = 0.1, ΔW m (s, l) = 0, ΔW l (s, l) = -0.1, small scale weight W s (S, H) is changed to 0.4, the mid-scale weight W m (S, H) is changed to 0.4, and the large scale weight W l (S, H) was changed to 0.2.
[0119] In autumn, ΔW s (s, l) = 0, ΔW m (s, l) = 0.1, ΔW l (s, l) = -0.1, small scale weight W s (S, H) is changed to 0.3, the mid-scale weight W m (S, H) is changed to 0.5, and the large scale weight W l (S, H) was changed to 0.2.
[0120] When it is winter and the light intensity is strong, ΔW s (s, l) = -0.1, ΔW m (s, l) = 0, ΔW l (s, l) = 0.1, small scale weight W s (S, H) is changed to 0.2, the mid-scale weight W m (S, H) is changed to 0.4, and the large scale weight W l (S, H) was changed to 0.4.
[0121] When it is winter and the light is weak, ΔW s (s, l) = -0.1, ΔW m (s, l) = -0.1, ΔW l (s, l) = 0.2, small scale weight W s (S, H) is changed to 0.2, the mid-scale weight W m (S, H) is changed to 0.3, and the large scale weight W l (S, H) is changed to 0.5.
[0122] S5: Automatically evaluate the annotation results through pre-defined indicators.
[0123] The automatic evaluation of the annotation results through pre-defined indicators includes manually reviewing the number of tree species incorrectly labeled by the SAM model, obtaining the accuracy of the automatic evaluation annotation results, listing the accuracy of different tree species, and expanding the training samples of the corresponding tree species when the accuracy of the tree species is less than or equal to 95%.
[0124] Example 2, reference Figure 2 , which is an embodiment of the present invention, provides a system for a highly robust automatic labeling method for tree species data based on the SAM model, characterized in that it includes a data acquisition and preprocessing module, a model building and training module, a feature fusion and decision module, and a performance evaluation module.
[0125] The data acquisition and preprocessing module is responsible for collecting tree species image data and processing the collected image data.
[0126] The model building and training module is responsible for building the SAM model and training the SAM model.
[0127] In the feature fusion layer, the feature fusion and decision module dynamically adjusts the feature weights of different scales according to the changes in light intensity and seasons, and outputs the tree species labeling results of each input image based on the fused features, that is, classifies each image into a specific tree species category.
[0128] The performance evaluation module automatically evaluates the quality of the annotation results through pre-set performance indicators.
[0129] 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 method 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 code.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] Embodiment 3: In this embodiment, in order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments. This embodiment experiments the existing traditional method and the method of this embodiment respectively.
[0134] Traditional methods: Image classification and annotation based on manual feature extraction and classic classifiers (such as support vector machines).
[0135] New method: Use a dynamically adjusted multi-scale convolutional neural network (CNN) to adjust the convolutional layer parameters according to the season and lighting conditions.
[0136] Evaluation index: classification accuracy. We only compare the classification results under spring and winter seasons and lighting conditions, as shown in Table 1.
[0137] Table 1 Experimental effect comparison chart
[0138] method season Light intensity Classification accuracy (%) Traditional methods spring powerful 78.5 spring weak 72.3 winter powerful 75.8 winter weak 70.1 New approach spring powerful 82.4 spring weak 79.2 winter powerful 81 winter weak 76.5
[0139] The classification accuracy of traditional methods is relatively stable in different seasons and lighting conditions, but there is no dynamic adjustment for environmental conditions.
[0140] The new method significantly improves the classification accuracy under spring and winter lighting conditions by dynamically adjusting the convolution layer parameters. This is because the new method can adaptively adjust the feature extraction process according to the season and light intensity, thereby more effectively distinguishing tree species images under different conditions.
[0141] 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. A highly robust automatic labeling method for tree species data based on the SAM model, characterized in that: include: Collect image data of tree species and perform preprocessing; Manually annotate the preprocessed image data; Build a SAM model and train the SAM model using labeled image data; Input the tree species image to be labeled into the SAM model; Automatically evaluate annotation results using pre-defined metrics.
2. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 1, characterized in that: The image data of the tree species are image data of different seasons and different lighting conditions; The preprocessing includes removing noise data and repeated data from the image data.
3. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 2, characterized in that: The construction of the SAM model includes extracting features from the tree species image using a multi-level convolutional layer, adding a fusion feature strategy to the SAM model, and fusing features extracted at different scales; The multi-level convolutional layer includes an initial convolutional layer, a multi-scale convolutional layer, a feature fusion layer and a decision layer; The different scales include small scale, medium scale and large scale.
4. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 3, characterized in that: The training of the SAM model includes dividing the labeled tree species image data into a training set, a validation set and a test set, training the SAM model through the training set, monitoring the performance of the SAM model through the validation set, and evaluating the SAM model through the test set.
5. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 4, characterized in that: The inputting the tree species image to be labeled into the SAM model includes extracting the tree species image data to be labeled according to the initial convolution layer, wherein the tree species image data includes the changes of leaves in spring, summer, autumn and winter, as well as strong and weak light; The light intensity is when the average brightness is higher than the first level threshold, and the light weakness is when the average brightness is lower than the second level threshold; The multi-scale convolution layer dynamically adjusts the response strength of the filter through a seasonal light adjustment function, and the response strength includes a scale factor and an offset; The seasonal light adjustment function is expressed as: γ(c)=γ0×(1+f(s,l)) β(c)=β0+g(s,l) Where γ(c) represents the scale factor, β(c) represents the offset, γ0 represents the baseline scale parameter, β0 represents the baseline offset parameter, f(s,l) is the subsidiary function for adjusting the scale factor, and g(s,l) is the subsidiary function for adjusting the offset; The auxiliary function of the adjustment scale factor is expressed as, f(s,l)=a s +b l +d sl ·(s∧l) The auxiliary function of adjusting the offset is expressed as, g(s,l)=a s +b l +d sl ·(s∧l) The a s represents the adjustment coefficient for season s, b l Indicates the adjustment coefficient of light l, d sl represents the interaction adjustment coefficient between season s and light l, δ sl represents the interaction effect coefficient between season s and light l, α s represents the basic offset of season s, β l Represents the basic offset of the illumination l, and ∧ represents the logical AND.
6. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 5, characterized in that: The dynamic adjustment of the response strength of the filter includes: when it is spring and the light is strong, increasing the proportional factor, increasing the offset, f(s, l) and g(s, l) are respectively positive; when it is spring and the light is weak, increasing the proportional factor, reducing the offset, f(s, l) is positive, and g(s, l) is negative; When it is summer and the light is strong, the scale factor and offset are reduced, and f(s,l) and g(s,l) are negative. When it is summer and the light is weak, the scale factor is reduced, f(s,l) is negative, the offset is increased, and g(s,l) is positive. When it is autumn, the scale factor and offset are increased, and f(s,l) and g(s,l) are positive; When it is winter and the light is strong, the scale factor and offset are reduced, f(s,l) and g(s,l) are negative; when it is winter and the light is weak, the scale factor is reduced and the offset is increased, f(s,l) is negative and g(s,l) is positive; The feature fusion layer applies different fusion strategies according to the light intensity and season. When there is no light influence in a specific season, the small-scale weight W s (s, l) is 0.3, and the mid-scale weight W m (s, l) is 0.4, and the large-scale weight W l (s, l) is 0.3; Defining ΔW s (s, l), ΔW m (s, l), ΔW l (s, l) is the adjustment factor based on season s and light l. The small-scale weight, medium-scale weight and large-scale weight affected by season s and light l are expressed as, W s (S,H)=W s (s,l)+ΔW s (s,l) W m (S,H)=W m (s,l)+ΔW m (s,l) W l (S,H)==W l (s,l)+ΔW l (s,l) When it is spring and the light is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive; When it is spring and the light is weak, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative; When it is summer and the light is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive; When it is summer and the light is weak, ΔW s (s, l) is positive, ΔW m (s, l) = 0, ΔW l (s, l) is negative; In autumn, ΔW s (s, l) = 0, ΔW m (s, l) is positive, ΔW l (s, l) is negative; When it is winter and the light intensity is strong, ΔW s (s, l) is negative, ΔW m (s, l) = 0, ΔW l (s, l) is positive; When it is winter and the light is weak, ΔW s (s, l) is negative, ΔW m (s, l) is negative, ΔW l (s, l) is positive; The decision layer outputs the labeling results of the tree species image data to determine the tree species category.
7. The highly robust automatic labeling method for tree species data based on the SAM model as claimed in claim 6, characterized in that: The automatic evaluation of the labeling results by using pre-defined indicators includes manually reviewing the number of tree species incorrectly labeled by the SAM model, obtaining the accuracy of the automatic evaluation labeling results, listing the accuracy of different tree species, and expanding the training samples of the corresponding tree species when the accuracy of a tree species is less than or equal to 95%.
8. A system using the highly robust automatic labeling method for tree species data based on the SAM model as claimed in any one of claims 1 to 7, characterized in that: It includes data collection and preprocessing module, model building and training module, feature fusion and decision module and performance evaluation module; The data acquisition and preprocessing module is responsible for collecting tree species image data and processing the collected image data; The model building and training module is responsible for building the SAM model and training the SAM model; The feature fusion and decision module dynamically adjusts the feature weights of different scales in the feature fusion layer according to the changes in light intensity and seasons, and outputs the tree species labeling result of each input image according to the fused features, that is, classifies each image into a specific tree species category; The performance evaluation module automatically evaluates the quality of the annotation results through pre-set performance indicators.
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 highly robust automatic labeling method for tree species data based on the SAM model described in 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 highly robust automatic labeling method for tree species data based on the SAM model described in any one of claims 1 to 7 are implemented.