Methods, devices, equipment, and media for identifying street tree species in street view images.
By using a YOLO supervised model and a semi-supervised object detection framework in street view imagery, combined with a global domain adaptive module and an enhanced pseudo-label adapter, the economic and accuracy issues in large-scale urban street tree assessment are addressed, achieving low-cost and efficient street tree species identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU UNIVERSITY
- Filing Date
- 2025-01-08
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies struggle to balance cost-effectiveness and accuracy in large-scale urban street tree assessments. Traditional field surveys are costly, advanced sensor equipment is expensive and lacks individual identification accuracy, and street view data annotation is costly and complex, making it difficult to identify street tree species.
A semi-supervised object detection framework combining a YOLO supervised model, a global domain adaptive module, and an enhanced pseudo-label adapter is adopted from street view imagery. By acquiring street view datasets and individual tree species datasets, a tree species identification model is trained, the utilization rate of pseudo-labels is optimized, and the identification accuracy is improved.
It significantly reduced the cost of sample screening and labeling, improved the training effect of tree species identification models and the accuracy of tree species identification in street view images, and achieved low-cost and efficient identification of street tree species.
Smart Images

Figure CN120047822B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and in particular to a method, apparatus, equipment and medium for identifying the species of roadside trees in street view images. Background Technology
[0002] A timely and updated list of street tree species is crucial for urban management and planning. Different types of street trees have relatively different functions and advantages, allowing them to play specific roles in urban services and ecological benefits. For example, some tree species excel at absorbing particulate matter and carbon dioxide from the air and are often used to improve urban air quality, while others are better suited to providing shade and cooling in high-temperature areas. Furthermore, the selection and distribution of street trees also affect urban biodiversity, landscape aesthetics, and the mental health of residents.
[0003] Currently, common methods for assessing urban street trees include field surveys, LiDAR (Light Detection and Ranging), satellite imagery, and street view recognition. Traditional field surveys are often labor-intensive and time-consuming, especially in large-scale urban street tree surveys, where they are prohibitively expensive. With advancements in computer vision technology, advanced sensors (such as LiDAR and remote sensing satellites) have made significant progress in urban tree surveys. For example, LiDAR demonstrates high accuracy and feasibility in tree species identification by capturing the three-dimensional structure of trees; satellite imagery identifies trees based on their spectral radiance and surface reflectance, making it suitable for large-scale assessments. Nevertheless, due to high equipment costs or insufficient individual identification accuracy, these technologies struggle to balance economy and accuracy in large-scale urban street tree assessments, lacking cost-effectiveness. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, and medium for identifying street tree species in street view images, so as to reduce the cost of identifying street tree species and improve the accuracy of identification.
[0005] To achieve the above objectives, one aspect of this application proposes a method for identifying street tree species in street view images, the method comprising the following steps:
[0006] Obtain a street view dataset of the study area; wherein, the street view dataset includes images of street trees on both sides of the street;
[0007] Obtain a dataset of individual trees of various tree species; wherein, the dataset of individual trees of various tree species includes images of individual trees of various labeled tree species;
[0008] A YOLO supervised model was trained using the single-tree dataset of the aforementioned tree species, resulting in the trained YOLO supervised model.
[0009] A global domain adaptation module and an enhanced pseudo-label adapter are added to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework. The global domain adaptation module is used to align the features of the street view dataset and the tree species single-tree dataset. The enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression.
[0010] The street view dataset, the tree species single tree dataset, and the trained YOLO supervised model are input into the semi-supervised domain adaptation framework for training to obtain the tree species recognition model.
[0011] The tree species identification model is used to identify the species of street trees.
[0012] In some embodiments, obtaining the street view dataset of the study area includes the following steps:
[0013] Street view sampling points were generated in the streets of the study area using a set distance threshold.
[0014] Images of the street trees on both sides of the street are captured using cameras at each of the street view sampling points in 90° and 270° directions;
[0015] The formula for calculating the set distance threshold is:
[0016] T = 2 * A × tan45° - I;
[0017] Where T is the set distance threshold; A is the distance between the camera and both sides of the street; 45° is the field of view of each street view sampling point; and I is the overlapping part of adjacent fields of view.
[0018] In some embodiments, obtaining a single tree species dataset includes the following steps:
[0019] Images of individual trees of various labeled tree species are obtained from different data open platforms to form a single tree dataset for the tree species.
[0020] In some embodiments, training a YOLO supervised model using the single-tree dataset of the tree species to obtain the trained YOLO supervised model includes the following steps:
[0021] Data augmentation is performed on the dataset of individual trees of the aforementioned tree species to obtain an augmented dataset of individual trees of the aforementioned tree species; wherein, the data augmentation includes adjusting the exposure, reducing the light intensity, randomly cropping, scaling, and mirroring of each individual tree image;
[0022] Using the individual tree images in the enhanced tree species dataset as training samples and the labeled tree species as training labels, the YOLO supervised model is trained to obtain the trained YOLO supervised model.
[0023] In some embodiments, adding the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework includes the step of constructing the global domain adaptation module. The step of constructing the global domain adaptation module includes the following steps:
[0024] Determine the mixing coefficients; wherein the mixing coefficients are used to determine the proportion of the roadside tree images and the proportion of the single tree images used when training the semi-supervised domain adaptation framework;
[0025] The formula for calculating the mixing coefficient is:
[0026]
[0027] Where α is the mixing coefficient, α min The minimum value of the mixing coefficient is given by β, where D is the feature distance and β represents the hyperparameter controlling the influence of the feature distance on the mixing coefficient.
[0028] The formula for calculating the feature distance is:
[0029] D = ||U S -U T ||;
[0030] Among them, U S U T These represent the feature mean vectors of the source domain and the target domain, respectively; the source domain is the single tree dataset of the tree species, and the target domain is the street view dataset.
[0031] The formula for calculating the feature mean vector is:
[0032]
[0033] Where U is the feature mean vector, N represents the number of images in the dataset, f(x) represents the feature extraction function of the YOLO supervised model, and x i This represents the images in the dataset;
[0034] Based on the mixing coefficient, a mixed sample is generated using the street view dataset and the prime tree species single-tree dataset;
[0035] The expression for the mixed sample is:
[0036]
[0037] in, For the mixed sample, x S For the image of the source domain, x T The image of the target domain;
[0038] The global domain adaptive module is constructed based on the mixed samples and the domain adaptation loss function;
[0039] The expression for the domain adaptation loss function is:
[0040] L da =-∑ h,w [B log p(h, w)+(1-B)log(1-p(h, w))];
[0041] Among them, L da Let p(h, w) be the domain adaptation loss function, p(h, w) be the output of the global domain adaptation module, and B = 0 represent labeled images and B = 1 represent unlabeled images.
[0042] In some embodiments, adding the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain the semi-supervised domain adaptation framework includes the step of constructing the enhanced pseudo-label adapter, which includes the following steps:
[0043] Based on the original pseudo-label adapter of the Efficient Teacher framework, pseudo-labels are divided into reliable pseudo-labels and uncertain pseudo-labels;
[0044] The reliable pseudo-labels that were discarded due to regression error were identified as auxiliary pseudo-labels;
[0045] Determine the semi-supervised training loss function based on the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label;
[0046] The expression for the semi-supervised training loss function is:
[0047]
[0048] Among them, L U Let be the semi-supervised training loss function. These are the classification loss term, regression loss term, and object loss term for semi-supervised training, respectively.
[0049] in:
[0050]
[0051] Wherein, RPL, APL, and UPL are the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label, respectively. The sampling result of the original pseudo-label adapter representing the position (h, w) on the feature map. The objectivity score representing the pseudo-label at (h,w) The indicator function outputs 1 if the condition is met, and 0 otherwise; CE represents the cross-entropy loss function, CIoU represents the perfect intersection between the predicted and ground truth boxes, and X... (h,w) This is the output of the student model; cls, reg, and obj represent the classification score, regression score, and objective score, respectively.
[0052] In some embodiments, identifying street tree species using the tree species identification model includes the following steps:
[0053] The tree species identification model is used to identify street scene images taken on both sides of any street to obtain the street tree species in the street scene images.
[0054] To achieve the above objectives, another aspect of this application proposes a device for identifying street tree species in street view images, the device comprising:
[0055] The first dataset acquisition unit is used to acquire street view datasets of the study area; wherein, the street view datasets include images of street trees on both sides of the street;
[0056] The second dataset acquisition unit is used to acquire a single tree dataset; wherein, the single tree dataset includes images of single trees of various labeled tree species;
[0057] The model training unit is used to train the YOLO supervised model using the single tree dataset of the tree species, and obtain the trained YOLO supervised model.
[0058] The framework modification unit is used to add the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework; wherein, the global domain adaptation module is used to align the features of the street view dataset and the tree species single tree dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression.
[0059] The model improvement unit is used to input the street view dataset, the tree species single tree dataset and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training to obtain the tree species recognition model.
[0060] A tree species identification unit is used to identify the species of street trees using the tree species identification model.
[0061] To achieve the above objectives, another aspect of this application proposes an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method for identifying street tree species in street view images.
[0062] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for identifying street tree species in street view images.
[0063] The embodiments of this application include at least the following beneficial effects:
[0064] This application can obtain a street view dataset of the study area, which includes images of roadside trees on both sides of the street; obtain a single tree species dataset, which includes images of single trees of various labeled tree species; train a YOLO supervised model using the single tree species dataset to obtain the trained YOLO supervised model; add a global domain adaptation module and an enhanced pseudo-label adapter to a semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework; wherein the global domain adaptation module is used to align the features of the street view dataset and the single tree species dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression; input the street view dataset, the single tree species dataset, and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training to obtain a tree species recognition model; and use the tree species recognition model to identify the tree species of the roadside trees. This application utilizes a street view dataset and a dataset of labeled individual trees to train the model, avoiding various challenges in obtaining labeled tree species samples from street view images and significantly reducing the cost of sample selection and labeling. Furthermore, this application uses global domain adaptive alignment of features between the street view dataset and the dataset of individual trees, and utilizes an enhanced pseudo-label adapter to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression. This further improves the utilization rate of pseudo-labels, enhances the training effect of the tree species recognition model, and thus improves the accuracy of tree species recognition in street view images. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1A flowchart illustrating a method for identifying street tree species in street view images, provided in an embodiment of this application;
[0067] Figure 2 An example flowchart of a method for identifying street tree species in street view images provided in this application embodiment;
[0068] Figure 3 This is a schematic diagram of the street view sampling point interval provided in the embodiments of this application;
[0069] Figure 4 A flowchart of the improved semi-supervised target detection framework provided in the embodiments of this application;
[0070] Figure 5 A flowchart illustrating the workflow of the global domain adaptive module provided in this application embodiment;
[0071] Figure 6 A flowchart illustrating the process of the enhanced pseudo-tag adapter provided in this application embodiment;
[0072] Figure 7 A schematic diagram of a device for identifying street tree species in street view images provided in this application embodiment;
[0073] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0075] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0076] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0077] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0078] Before providing a detailed description of the embodiments of this application, some related technologies that may be involved in the embodiments of this application will be described first, as follows:
[0079] Due to high equipment costs or insufficient individual identification accuracy, existing technologies struggle to balance economy and accuracy in large-scale urban street tree assessment, lacking cost-effectiveness. In contrast, street view data, as a publicly accessible resource, is undoubtedly the best choice for large-scale urban street tree assessment due to its high resolution, wide coverage, and near-human perspective. In fact, the use of street view data for large-scale urban street tree assessment has made encouraging progress. Research shows that, given a sufficient quantity of high-quality labeled datasets, combined with advanced object detection algorithms, large-scale urban street tree assessment using street view data as the primary data source has been successful in some cities.
[0080] However, the aforementioned technologies still have significant limitations, particularly the reliance on manual data selection and labeling, which is especially prominent in street view tree species identification tasks. This task faces two main challenges: First, street trees in streetscapes typically exhibit a long-tailed distribution (a few dominant species occupy the majority), along with low inter-class variance and high intra-class variance (indistinct differences between trees). This makes selecting representative street view tree species for labeling a resource-intensive and time-consuming process. Second, tree species labeling usually requires specialized botanical knowledge, and the complex background of street view data—where tree appearance changes due to perspective, lighting, and obstructions—leads to errors during labeling, and manual labeling is costly. Therefore, in the context of large-scale urban street tree assessment, there is an urgent need to propose a new solution to obtain or replace high-quality and widely representative street view tree species labeling data at a lower cost.
[0081] This application provides a method, apparatus, device, and medium for identifying street tree species in street view images. The technical solution includes: acquiring a street view dataset of the study area; wherein the street view dataset includes images of street trees on both sides of the street; acquiring a single tree species dataset; wherein the single tree species dataset includes images of single trees of various labeled tree species; training a YOLO supervised model using the single tree species dataset to obtain a trained YOLO supervised model; adding a global domain adaptation module and an enhanced pseudo-label adapter to a semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework; wherein the global domain adaptation module is used to align features between the street view dataset and the single tree species dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression; inputting the street view dataset, the single tree species dataset, and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training to obtain a tree species identification model; and using the tree species identification model to identify the street tree species. This application utilizes a street view dataset and a dataset of labeled individual trees to train the model, avoiding various challenges in obtaining labeled tree species samples from street view images and significantly reducing the cost of sample selection and labeling. Furthermore, this application uses global domain adaptive alignment of features between the street view dataset and the dataset of individual trees, and utilizes an enhanced pseudo-label adapter to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression. This further improves the utilization rate of pseudo-labels, enhances the training effect of the tree species recognition model, and thus improves the accuracy of tree species recognition in street view images.
[0082] This application provides a method, apparatus, device, and storage medium for identifying street tree species in street view images, relating to the field of image recognition technology. The method, apparatus, device, and medium provided in this application for identifying street tree species in street view images can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or vehicle terminal, but is not limited to these; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application implementing knowledge extraction methods, but is not limited to the above forms.
[0083] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0084] Reference Figure 1 This application provides a method for identifying the species of roadside trees in street view images. This method may include, but is not limited to, steps S100 to S150, as follows:
[0085] S100: Obtain the street view dataset of the study area; wherein, the street view dataset includes images of roadside trees on both sides of the street.
[0086] Furthermore, S100 may include the following steps S101 to S102:
[0087] S101: Street view sampling points are generated on the streets of the study area using a set distance threshold;
[0088] S102: At each of the street view sampling points, use a camera to capture images of the street trees on both sides of the street in 90° and 270° directions;
[0089] The formula for calculating the set distance threshold is:
[0090] T = 2 * A × tan45° - I;
[0091] Where T is the set distance threshold; A is the distance between the camera and both sides of the street; 45° is the field of view of each street view sampling point; and I is the overlapping part of adjacent fields of view.
[0092] S110: Obtain a single tree dataset for a tree species; wherein, the single tree dataset for a tree species includes images of single trees of various labeled tree species.
[0093] Further, S110 may include the following step S111:
[0094] S111: Obtain images of individual trees of various labeled tree species from different data open platforms to form a single tree dataset for the tree species.
[0095] S120: Train the YOLO supervised model using the single tree dataset of the aforementioned tree species to obtain the trained YOLO supervised model.
[0096] Furthermore, S120 may include the following steps S121 to S123:
[0097] S121: Perform data augmentation on the tree species single tree dataset to obtain the augmented tree species single tree dataset; wherein, the data augmentation includes exposure reduction, light reduction, random cropping, scaling and mirroring of each single tree image;
[0098] S122: Using the images of each individual tree in the enhanced tree species single-tree dataset as training samples and the labeled tree species as training labels, train the YOLO supervised model to obtain the trained YOLO supervised model.
[0099] S130: The global domain adaptation module and the enhanced pseudo-label adapter are added to the semi-supervised object detection framework to obtain the semi-supervised domain adaptation framework; wherein, the global domain adaptation module is used to align the features of the street view dataset and the tree species single tree dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression.
[0100] Further, S130 includes the step of constructing the global domain adaptive module, which includes the following steps S131 to S133:
[0101] S131: Determine the mixing coefficients; wherein the mixing coefficients are used to determine the proportion of the roadside tree images and the proportion of the single tree images used when training the semi-supervised domain adaptation framework;
[0102] The formula for calculating the mixing coefficient is:
[0103]
[0104] Where α is the mixing coefficient, α min The minimum value of the mixing coefficient is given by β, where D is the feature distance and β represents the hyperparameter controlling the influence of the feature distance on the mixing coefficient.
[0105] The formula for calculating the feature distance is:
[0106] D = || U S -U T ||;
[0107] Among them, U S U T These represent the feature mean vectors of the source domain and the target domain, respectively; the source domain is the single tree dataset of the tree species, and the target domain is the street view dataset.
[0108] The formula for calculating the feature mean vector is:
[0109]
[0110] Where U is the feature mean vector, N represents the number of images in the dataset, f(x) represents the feature extraction function of the YOLO supervised model, and x i This represents the images in the dataset;
[0111] S132: Generate a mixed sample using the street view dataset and the prime tree species single-tree dataset based on the mixing coefficient;
[0112] The expression for the mixed sample is:
[0113]
[0114] in, For the mixed sample, x S For the image of the source domain, x T The image of the target domain;
[0115] S133: Construct the global domain adaptive module based on the mixed samples and the domain adaptation loss function;
[0116] The expression for the domain adaptation loss function is:
[0117] L da =-∑ h,w [Blogp(h,w)+(1-B)log(1-p(h,w))];
[0118] Among them, L da Let p(h,w) be the domain adaptation loss function, and let B = 0 represent a labeled image and B = 1 represent an unlabeled image.
[0119] Further, S130 includes the step of constructing the enhanced pseudo-tag adapter, which includes the following steps S134 to S136:
[0120] S134: Based on the original pseudo-label adapter of the Efficient Teacher framework, pseudo-labels are divided into reliable pseudo-labels and uncertain pseudo-labels;
[0121] S135: The reliable pseudo-labels that were discarded due to regression error are identified as auxiliary pseudo-labels;
[0122] S136: Determine the semi-supervised training loss function based on the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label;
[0123] The expression for the semi-supervised training loss function is:
[0124]
[0125] Among them, L U Let be the semi-supervised training loss function. These are the classification loss term, regression loss term, and object loss term for semi-supervised training, respectively.
[0126] in:
[0127]
[0128] Wherein, RPL, APL, and UPL are the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label, respectively. The sampling result of the original pseudo-label adapter representing the position (h,w) on the feature map. The objectivity score representing the pseudo-label at (h,w) The indicator function outputs 1 if the condition is met, and 0 otherwise; CE represents the cross-entropy loss function, CIoU represents the perfect intersection between the predicted and ground truth boxes, and X... (h,e) This is the output of the student model; cls, reg, and obj represent the classification score, regression score, and objective score, respectively.
[0129] S140: Input the street view dataset, the tree species single tree dataset, and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training to obtain the tree species recognition model.
[0130] S150: Identify the species of roadside trees using the tree species identification model.
[0131] Furthermore, S150 may include the following step S151:
[0132] S151: Use the tree species identification model to identify street scene images taken on both sides of any street, and obtain the street tree species in the street scene images.
[0133] The following section will provide a detailed introduction and explanation of the solutions in the embodiments of this application, using specific application examples.
[0134] Based on the problems existing in the current technology, this embodiment proposes a method for efficient identification of street tree species in street view images based on semi-supervised domain adaptation. The specific improvement ideas are as follows:
[0135] First, addressing the difficulty of selecting tree species for annotation in street view data, this embodiment proposes an innovative solution: utilizing tree species image resources from an open data platform to replace the manual selection of tree species within the street view data. This solution not only significantly reduces the time and resources required in the traditional data selection process but also enables the rapid construction of a broadly representative dataset.
[0136] Secondly, after obtaining a widely representative tree species dataset from the data open platform, this embodiment further filters out individual tree images to reduce annotation costs. Data augmentation techniques are then used to process these images, simulating the variations in tree species in street scenes caused by factors such as perspective, lighting, and occlusion. These processing methods offer additional benefits: individual tree images ensure that each image in the dataset represents a single characteristic of that tree species, thereby improving the accuracy and relevance of the dataset; data augmentation effectively expands the scale and diversity of the dataset, enhancing the model's generalization ability.
[0137] Finally, to address the domain differences between the single tree dataset and the street view dataset, this embodiment performs cross-domain learning on single tree images and street view images, improving the model's ability to identify tree species on street view data through semi-supervised domain adaptation.
[0138] For example, Figure 2 This is an example flowchart of a method for identifying street tree species in street view imagery.
[0139] Specifically, this embodiment may include the following steps:
[0140] Step 1:
[0141] A street view dataset of the study area was collected. In this embodiment, street view sampling points were generated using the street network of the study area with a set threshold distance (T), and trees on both sides of the road were detected in the 90° and 270° directions. Figure 3 The diagram shows the interval between street view sampling points. Since the field of view of each street view sampling point is 45°, the calculation formula for the threshold T between street view sampling points is shown in equation (1):
[0142] T=2*A×tan45°-I(1)
[0143] Where A is the distance between the camera and the roadside, and I is the overlapping part of adjacent fields of view.
[0144] By preserving a small amount of tree overlap, we ensure that the selected street view dataset can fully cover all street trees and maintain a reasonable perspective.
[0145] Step 2:
[0146] This embodiment collects publicly available tree species individual tree datasets. By consulting government documents, this embodiment can identify common street tree species in the study area. Subsequently, this embodiment uses an open data platform to crawl relevant tree species datasets and filters out individual tree species datasets from them.
[0147] 1) Data augmentation: Data augmentation processing is performed on individual tree images, including exposure reduction, light reduction, random cropping, scaling, and mirroring, to simulate the changes in tree species in street scenes due to factors such as lighting, occlusion, and viewing angle.
[0148] 2) Training the YOLOv5 supervised model: Using the enhanced tree species single-tree dataset, train the YOLOv5 object detection model, learn the features of trees and perform object localization to obtain the YOLO supervised model.
[0149] Step 3:
[0150] An improved semi-supervised object detection framework, Efficient Teacher, is proposed to obtain a semi-supervised domain adaptation framework. Efficient Teacher (ET) is an efficient semi-supervised object detection framework that focuses on improving the performance of a one-stage anchor-based detector (YOLOv5) while balancing detection efficiency and pseudo-label quality consistency.
[0151] like Figure 4 The flowchart shown illustrates that the improved semi-supervised object detection framework can be divided into two steps: First, data processing, which generates unlabeled street view data and labeled tree species images. The labeled tree species images are used to train a YOLO supervised model. See steps 1 and 2 for details. Second, model training, which inputs the unlabeled street view data, labeled tree species images, and the YOLO supervised model into the semi-supervised domain adaptation framework to achieve knowledge transfer from the source domain to the target domain. The semi-supervised domain adaptation framework is based on the open-source semi-supervised object detection framework Efficient Teacher, optimized by introducing a Global Domain Adaptor module and an Enhanced Pseudo Label Assigner. The following is a detailed explanation of the two improved modules. Figure 4In the context of data augmentation, "Mosaic" represents an augmentation technique that stitches multiple images together to form a new training sample; "Strong" represents strong data augmentation, which includes multiple augmentation strategies; "EMA" (Exponential Moving Average) is a technique commonly used to smooth data, and in semi-supervised object detection, it is used to smooth the generation process of pseudo-labels; in the one-stage object detection algorithm YOLO, "Backbone" is the feature extraction network, "Neck" is the feature fusion module, and "Head" is the prediction layer that outputs the detection results.
[0152] 1) Global Domain Adaptor Module:
[0153] The Efficient Teacher (ET) framework introduces the concept of Burn-in, meaning that in the early stages of training, the model undergoes a period of supervised training to warm up before semi-supervised training begins. This stage does not generate pseudo-labels; instead, it uses domain adaptation to help the model adapt to unlabeled data, aiming to stabilize the model during the early training phase. However, the above method in the original framework is mainly local and limited domain adaptation, reflected in the supervised training loss function L. S In terms of computation, the original ET framework performs domain adaptation through weighted loss, and the specific calculation formula is shown in equation (2):
[0154]
[0155] Where CE represents the cross-entropy loss function, CIoU represents the perfect intersection between the predicted bounding box and the ground truth bounding box, and X (h,w) This is the output of the student model, Y. (h,w) This represents the sampling results generated by the YOLO detector, where cls, reg, and obj represent the classification score, regression score, and target score, respectively. da λ is the domain adaptation loss function, and λ is a hyperparameter that controls the domain adaptation contribution. The ET framework sets it to 0.1.
[0156] The original domain adaptation scheme of the ET framework, which simply uses a weighted summation with a fixed λ, clearly cannot meet the cross-domain requirements of this experiment. Therefore, as... Figure 5 This embodiment proposes a global domain adaptive improvement scheme. For ease of description, this embodiment defines the labeled tree species single-tree dataset as the source domain and the unlabeled street view dataset as the target domain. In this scheme, this embodiment introduces Mixup data mixing technology and dynamically adjusts the mixing coefficient α based on the feature distance between the source and target domains to smoothly achieve global alignment between the source and target domains. Figure 5In this context, Burn-In represents a period of pre-training supervised training for the semi-supervised domain adaptation framework during the initial training phase; Mixup represents an augmentation technique that uses data mixing to generate new samples. These represent the classification loss term, regression loss term, and object loss term during supervised training, respectively; L da This represents the domain adaptation loss term during supervised training. Specifically, it may include the following steps:
[0157] (1) At the start of training, the mixing coefficient α is fixed at 1, and training is performed using only the source domain.
[0158] (2) As training progresses, the target domain is gradually introduced into the training. The core idea is to dynamically adjust the value of the mixing coefficient α by calculating the distance D between the features of the source domain and the target domain, thereby achieving a smooth transition between the source domain and the target domain data.
[0159] Feature mean calculation: In each epoch, the mean vectors of the source domain and target domain features are calculated respectively. The formula for calculating the mean vector U is shown in equation (3):
[0160]
[0161] Where N represents the number of datasets, f(x) represents the feature extraction function of the YOLO detector, and x i Indicates a sample.
[0162] Feature distance calculation: The Euclidean distance is used to measure the difference between the feature means of the source domain and the target domain. The calculation formula is shown in equation (4):
[0163] D = || U S -U T ‖(4)
[0164] Where D represents the feature distance, U S U T Let represent the feature mean vectors of the source domain and the target domain, respectively.
[0165] Calculation of the mixing coefficient α: When D is large, the features of the source domain and the target domain differ significantly. To avoid introducing excessive noise, the model should be trained primarily on the source domain. In this case, α is close to 1, and the proportion of target domain data introduced is relatively low. When D is small, the feature distributions of the source domain and the target domain tend to be consistent, indicating that the timing for introducing target domain data is ripe. In this case, α gradually decreases, and the proportion of target domain data gradually increases, enabling the model to transition smoothly and achieve domain adaptation. The formula for calculating the mixing coefficient α is shown in equation (5):
[0166]
[0167] Where β represents a hyperparameter that controls the degree of influence of the feature distance D on α.
[0168] (3) Generating Mixed Samples: In this embodiment, the source domain and target domain samples are weighted and mixed by controlling the Mixup coefficient to generate new training samples. The purpose is to provide a smooth way to introduce target domain data globally, thereby optimizing the cross-domain learning process. The formula for calculating the mixed samples is shown in Equation (6):
[0169]
[0170] in, x S x T These are, respectively, mixed samples, source domain samples, and target domain samples.
[0171] (4) Domain Adaptation Loss Function L da Calculation: The ability of the confusion detector to distinguish between two data types is achieved by using a domain adaptation technique with a classifier, as shown in equation (7):
[0172] L da =-∑ h,w [Blogp(h,w)+(1-B)log(1-p(h,w))](7)
[0173] Where p(h,w) is the output of the domain classifier. B=0 represents labeled data, and B=1 represents unlabeled data.
[0174] (5) By dynamically mixing and combining gradient inversion, the model can smoothly incorporate target domain data features (such as...) during global training. Figure 5 As shown in the figure, this method avoids training instability caused by excessive differences in feature distribution between the source and target domains, and ultimately achieves better recognition performance in the target domain.
[0175] 2) Enhanced Pseudo Label Assigner:
[0176] The original pseudo-label adapter PLA in the Efficient Teacher (ET) framework employs a soft loss to handle uncertain pseudo-labels. PLA categorizes pseudo-labels into reliable and uncertain classes based on high and low thresholds. Uncertain pseudo-labels are assigned as soft labels to participate in regression and target loss calculations. This allows PLA to be used to optimize pseudo-labels that are accurate in regression but inaccurate in classification.
[0177] like Figure 6As shown, this embodiment proposes an Enhanced Pseudo-Label Adapter (EPLA) based on the PLA mechanism. It further categorizes pseudo-labels into reliable pseudo-labels, auxiliary pseudo-labels, and uncertain pseudo-labels. Auxiliary pseudo-labels are used to backtrack reliable pseudo-labels discarded due to regression errors, allowing them to participate in the calculation of classification loss. EPLA can not only optimize pseudo-labels that regress accurately but classify inaccurately, but also effectively handle pseudo-labels that classify accurately but regress inaccurately.
[0178] Background of EPLA Improvements: The ET framework focuses on improving the performance of YOLOv5. YOLOv5's anchor matching strategy changed from IOU matching to shape matching. This change discards predicted boxes that don't match anchors as background. However, in PLA, this approach clearly doesn't efficiently utilize reliable pseudo-labels. In practical applications, the number of reliable pseudo-labels is already relatively small. Furthermore, in effective semi-supervised learning, predicted boxes that don't match anchors account for as much as 30%. This excessive discarding leads to a significant amount of useful information being ignored, hindering the effective use of pseudo-labels.
[0179] (1) The semi-supervised training loss function L in EPLA U The calculation formula is as follows:
[0180]
[0181] in, These represent the classification loss term, regression loss term, and object-specific loss term during semi-supervised training, respectively. RPL, APL, and UPL represent reliable pseudo-labels, auxiliary pseudo-labels, and uncertain pseudo-labels, respectively. The PLA sampling result represents the position (h,w) on the feature map. The objectivity score representing the pseudo-label at (h,w) This represents an indicator function that outputs 1 if the condition is met, and 0 otherwise.
[0182] (2) The difference between EPLA and PLA. EPLA introduces auxiliary pseudo-labels, retaining reliable pseudo-labels with poor regression performance for classification loss calculation during semi-supervised training. This allows the classification based on cross-entropy during semi-supervised training to be replaced by soft labels (e.g., ...). Figure 6 As shown, this method uses soft loss to handle all pseudo-labels during semi-supervised training and extends the functionality of the pseudo-label allocator. It not only retains the optimization of pseudo-labels that are accurate in regression but inaccurate in classification in PLA, but also further realizes the purpose of converting pseudo-labels that are well classified but have insufficient regression into true positives.
[0183] Step 4:
[0184] To obtain a suitable model for tree species identification on street view data, and to verify the effectiveness of the semi-supervised domain adaptation framework, this embodiment uses manually selected and labeled street view validation sets to verify the model's accuracy, and conducts horizontal comparison and ablation experiments. The validation results are shown in Table 1.
[0185] Table 1. Horizontal comparison of experiments
[0186] Model mAP0.5 Study area (Choi et al., 2022) 0.564 City 1 (Branson et al., 2018) 0.581 City 2 (Liu et al, 2023) 0.587 City 3 The model in this embodiment 0.613 City 4
[0187] Existing studies such as (Choi et al., 2022), (Branson et al., 2018), and (Liu et al., 2023) that use SVI as the sole data source for street tree species classification demonstrate the superiority of the method presented in this embodiment by comparing it with existing schemes for identifying street tree species in street view imagery. mAP@0.5 (mean Average Precision at IoUthreshold 0.5) is a commonly used evaluation metric in object detection, representing the average precision of the model across all categories when the Intersection over Union (IoU) threshold is 0.5. That is, a prediction is considered correct only if the IoU between the predicted bounding box and the ground truth bounding box is greater than 0.5.
[0188] Table 2 Ablation Experiment
[0189]
[0190] Table 2 shows the progressive optimization of the framework in this embodiment across different aspects for each method in the ablation experiments. The final combined semi-supervised domain adaptation framework achieved the highest mAP50 value of 61.2 (an improvement of +2.6). mAP@50 (mean Average Precision at IoU threshold 50) is an evaluation metric in object detection, representing the average precision (AP) calculated for all classes at an IoU threshold of 50%. That is, a prediction is considered correct only if the IoU between the predicted bounding box and the ground truth bounding box is greater than or equal to 50%.
[0191] The semi-supervised domain adaptation framework proposed in this embodiment, by effectively combining labeled and unlabeled data, not only significantly reduces the sample acquisition cost for street scene tree species identification but also maintains high accuracy, achieving efficient identification of street scene tree species and possessing strong practical application potential. Therefore, the beneficial effects of this embodiment include:
[0192] (1) Reduce the cost of screening street view samples: This embodiment uses a semi-supervised domain adaptation framework to effectively screen high-quality samples from a large amount of unlabeled street view data for training. Researchers only need to focus on easily accessible publicly available tree species images. This embodiment not only reduces manual intervention in data screening, but also improves the automation of the screening process through a self-training mechanism, thereby significantly reducing the cost of screening street view samples.
[0193] (2) Reduced sample annotation costs: This embodiment reduces the number and difficulty of annotation tasks by combining a small amount of labeled data with a large amount of unlabeled data. With the help of pseudo-label generation and self-training mechanisms, the need for manual annotation is reduced, significantly lowering the annotation cost.
[0194] (3) Improve recognition accuracy: The semi-supervised domain adaptation framework in this embodiment improves the accuracy of street scene tree species recognition through knowledge transfer between the source domain and the target domain.
[0195] (4) Identify more tree species: By enhancing the model's generalization and adaptability, the framework is able to identify more types of tree species. Even if previously unseen tree species appear in the target domain (unlabeled street view data), the model can effectively identify them using learned features and extend to more tree species identification tasks.
[0196] Reference Figure 7 This application also provides a device for identifying street tree species in street view images, which can realize the above-mentioned method for identifying street tree species in street view images. The device includes:
[0197] The first dataset acquisition unit is used to acquire street view datasets of the study area; wherein, the street view datasets include images of street trees on both sides of the street;
[0198] The second dataset acquisition unit is used to acquire a single tree dataset; wherein, the single tree dataset includes images of single trees of various labeled tree species;
[0199] The model training unit is used to train the YOLO supervised model using the single tree dataset of the tree species, and obtain the trained YOLO supervised model.
[0200] The framework modification unit is used to add the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework; wherein, the global domain adaptation module is used to align the features of the street view dataset and the tree species single tree dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression.
[0201] The model improvement unit is used to input the street view dataset, the tree species single tree dataset and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training to obtain the tree species recognition model.
[0202] A tree species identification unit is used to identify the species of street trees using the tree species identification model.
[0203] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0204] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method for identifying street tree species in street view images. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0205] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0206] Please see Figure 8 , Figure 8 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0207] The processor 801 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0208] The memory 802 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and called and executed by the processor 801 to execute a method for identifying street tree species in street view images according to an embodiment of this application.
[0209] The 803 input / output interface is used to implement information input and output.
[0210] The communication interface 804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0211] Bus 805 transmits information between various components of the device (e.g., processor 801, memory 802, input / output interface 803, and communication interface 804);
[0212] The processor 801, memory 802, input / output interface 803, and communication interface 804 are connected to each other within the device via bus 805.
[0213] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for identifying street tree species in street view images.
[0214] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0215] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0216] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0217] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0218] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0219] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0220] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0221] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0222] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0223] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0224] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0225] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0226] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for identifying street tree species in street view images, characterized in that, The method includes the following steps: Obtain a street view dataset of the study area; wherein, the street view dataset includes images of street trees on both sides of the street; Obtain a dataset of individual trees of various tree species; wherein, the dataset of individual trees of various tree species includes images of individual trees of various labeled tree species; A YOLO supervised model was trained using the single-tree dataset of the aforementioned tree species, resulting in the trained YOLO supervised model. A global domain adaptation module and an enhanced pseudo-label adapter are added to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework. The global domain adaptation module is used to align the features of the street view dataset and the tree species single-tree dataset. The enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression. The street view dataset, the tree species single tree dataset, and the trained YOLO supervised model are input into the semi-supervised domain adaptation framework for training to obtain the tree species recognition model. The tree species identification model is used to identify the species of street trees; The steps for constructing the global domain adaptive module include: Determine the mixing coefficients; wherein the mixing coefficients are used to determine the proportion of the roadside tree images and the proportion of the single tree images used when training the semi-supervised domain adaptation framework; The formula for calculating the mixing coefficient is: ; wherein, is the mixing coefficient, is a minimum value of the mixing coefficient, is a characteristic distance, denotes a hyperparameter controlling the degree of influence of the characteristic distance on the mixing coefficient; The formula for calculating the feature distance is: ; wherein, , respectively represent the feature mean vector of the source domain and the target domain; the source domain is the tree species individual data set, and the target domain is the street view data set; The formula for calculating the eigenvalue mean vector is: ; wherein, is a feature mean vector, N represents the number of images in the dataset, f ( x ) represents a feature extraction function of the yolo supervising model, represents an image in the dataset; Based on the mixing coefficient, a mixed sample is generated using the street view dataset and the tree species individual dataset; The expression for the mixed sample is: ; wherein, is the mixed sample, is an image of the source domain, is an image of the target domain; The global domain adaptive module is constructed based on the mixed samples and the domain adaptation loss function; The expression for the domain adaptation loss function is: ; wherein, is the domain adaptation loss function for the domain, is the output of the global domain adaptation module, = 0 indicates a labeled image, = 1 indicates an unlabeled image; denotes a position on the feature map.
2. The method of claim 1, wherein, The process of obtaining the street view dataset for the study area includes the following steps: Street view sampling points were generated in the streets of the study area using a set distance threshold. capturing images of street trees on both sides of the street at each of the street scene sampling points using a camera directions and directions The formula for calculating the set distance threshold is: ; in, Set the distance threshold; The distance between the camera and both sides of the street; The field of view for each of the street view sampling points; This represents the overlapping portion of adjacent view areas.
3. The method for identifying street tree species in street view images according to claim 1, characterized in that, The process of obtaining a dataset of individual tree species includes the following steps: Images of individual trees of various labeled tree species are obtained from different data open platforms to form a single tree dataset for the tree species.
4. The method for identifying street tree species in street view images according to claim 1, characterized in that, The process of training a YOLO supervised model using the single-tree dataset of the aforementioned tree species to obtain the trained YOLO supervised model includes the following steps: Data augmentation is performed on the dataset of individual trees of the aforementioned tree species to obtain an augmented dataset of individual trees of the aforementioned tree species; wherein, the data augmentation includes adjusting the exposure, reducing the light intensity, randomly cropping, scaling, and mirroring of each individual tree image; Using the individual tree images in the enhanced tree species dataset as training samples and the labeled tree species as training labels, the YOLO supervised model is trained to obtain the trained YOLO supervised model.
5. The method for identifying street tree species in street view images according to claim 1, characterized in that, The step of adding the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain the semi-supervised domain adaptation framework includes the step of constructing the enhanced pseudo-label adapter, which includes the following steps: Based on the original pseudo-label adapter of the Efficient Teacher framework, pseudo-labels are divided into reliable pseudo-labels and uncertain pseudo-labels; The reliable pseudo-labels that were discarded due to regression error were identified as auxiliary pseudo-labels; Determine the semi-supervised training loss function based on the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label; The expression for the semi-supervised training loss function is: ; in, Let be the semi-supervised training loss function. , , These are the classification loss term, regression loss term, and object loss term for semi-supervised training, respectively. in: ; ; ; in, , , These are respectively the reliable pseudo-label, the auxiliary pseudo-label, and the uncertain pseudo-label. The sampling result of the original pseudo-label adapter representing the position (h,w) on the feature map. The objectivity score representing the pseudo-label at (h,w) The indicator function outputs 1 if the condition is met, and 0 otherwise; CE represents the cross-entropy loss function, and CIoU represents the perfect intersection between the predicted bounding box and the ground truth bounding box. This is the output of the student model; cls, reg, and obj represent the classification score, regression score, and objective score, respectively.
6. A method for identifying street tree species in street view images according to any one of claims 1 to 5, characterized in that, The process of identifying street tree species using the tree species identification model includes the following steps: The tree species identification model is used to identify street scene images taken on both sides of any street to obtain the street tree species in the street scene images.
7. A device for identifying street tree species in street view images, characterized in that, The device includes: The first dataset acquisition unit is used to acquire street view datasets of the study area; wherein, the street view datasets include images of street trees on both sides of the street; The second dataset acquisition unit is used to acquire a single tree dataset; wherein, the single tree dataset includes images of single trees of various labeled tree species; The model training unit is used to train the YOLO supervised model using the single tree dataset of the tree species, and obtain the trained YOLO supervised model. The framework modification unit is used to add the global domain adaptation module and the enhanced pseudo-label adapter to the semi-supervised object detection framework to obtain a semi-supervised domain adaptation framework; wherein, the global domain adaptation module is used to align the features of the street view dataset and the tree species single tree dataset; the enhanced pseudo-label adapter is used to optimize pseudo-labels that are accurate in regression but inaccurate in classification and pseudo-labels that are accurate in classification but inaccurate in regression; The model improvement unit is used to input the street view dataset, the tree species single tree dataset and the trained YOLO supervised model into the semi-supervised domain adaptation framework for training, so as to obtain the tree species recognition model. A tree species identification unit is used to identify the species of street trees using the tree species identification model. in: Constructing the global domain adaptive module includes: Determine the mixing coefficients; wherein the mixing coefficients are used to determine the proportion of the roadside tree images and the proportion of the single tree images used when training the semi-supervised domain adaptation framework; The formula for calculating the mixing coefficient is: ; in, The mixing coefficient is... This is the minimum value of the mixing coefficient. For feature distance, The hyperparameter represents the degree to which the feature distance affects the mixing coefficient; The formula for calculating the feature distance is: ; in, , These represent the feature mean vectors of the source domain and the target domain, respectively; the source domain is the single tree dataset of the tree species, and the target domain is the street view dataset. The formula for calculating the eigenvalue mean vector is: ; in, Let N be the feature mean vector, and N represent the number of images in the dataset. f ( x ) represents the feature extraction function of the YOLO supervised model. Represents the images in the dataset; Based on the mixing coefficient, a mixed sample is generated using the street view dataset and the tree species individual dataset; The expression for the mixed sample is: ; in, For the mixed sample, For the image of the source domain, The image of the target domain; The global domain adaptive module is constructed based on the mixed samples and the domain adaptation loss function; The expression for the domain adaptation loss function is: ; in, Let the domain adaptation loss function be... This is the output of the global domain adaptive module. =0 indicates that the image has been labeled. =1 indicates an unlabeled image; This indicates the position on the feature map.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement a method for identifying street tree species in street view images as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a method for identifying street tree species in street view images as described in any one of claims 1 to 6.