Orchid leaf recognition method based on multi-granularity spatial confusion and mutual contrast learning

CN122888337APending Publication Date: 2026-10-09DALI UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611375694.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

但现有数据集面临的主要挑战:一是除Orchid2024外,多数数据集样本量不足10,000张;二是生长阶段覆盖不全,以花期图像为主,缺乏非花期叶片数据;三是网络爬取图像背景杂乱、质量参差不齐;四是专门面向非花期叶片识别的数据集尚属空白

Benefits of technology

[0054](1)本发明针对非花期兰花叶片识别任务,构建了专门的非花期兰花叶片数据集(Guangdong Orchid Dataset),共包含56,118张图像,覆盖6个兰花物种、22个品种,涉及329株独立植株,填补了该领域的数据空白。数据集采用基于植株独立性的划分方式,确保训练集、验证集与测试集在物理植株上零重叠,能够更客观地评估模型对品种共性特征的学习能力和跨个体泛化性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888337A_ABST
    Figure CN122888337A_ABST
Patent Text Reader

Abstract

The application discloses a kind of orchid leaf identification method based on multi-granularity spatial chaos and mutual contrast learning, belong to image processing technical field.The present application aims to solve the problem that existing orchid variety identification method is seriously dependent on flowering flower image, and it is difficult to distinguish varieties only relying on leaf in non-flowering period.The method of the present application comprises: obtaining the orchid leaf image to be identified;The orchid leaf image is input into the pre-trained identification model, and the variety identification result is output;The identification model takes MobileNetV3-Large as the backbone network, includes multi-granularity spatial chaos module and mutual contrast learning mechanism.The multi-granularity spatial chaos module generates multiple spatial disturbance views by multi-granularity blocking and local window random rearrangement on the input image, and guides the model to focus on local discriminant features such as leaf veins and textures;The mutual contrast learning mechanism enhances the intra-class compactness and inter-class separability of the feature space through visual contrast loss and interactive contrast loss.The present application also constructs a non-flowering orchid leaf dataset containing 56,118 images, covering 6 species and 22 varieties.The experimental results show that the method of the present application achieves 95.15% recognition accuracy on the self-built dataset, which is better than a variety of existing models, and provides an effective solution for non-flowering orchid variety identification based on leaf image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to a method for orchid variety identification, and more particularly to an orchid leaf identification method based on multi-granular spatial disorder and mutual comparison learning, which can be applied to scenarios such as automated identification of orchid varieties during non-flowering season, intelligent planting management, and plant species identification. Background Technology

[0002] Orchids possess significant economic and ecological value, with their rich variety playing a vital role in ornamental, medicinal, ecological monitoring, and fragrance industries. However, with over 28,000 known orchid species worldwide, the numerous varieties exhibit striking similarities in appearance, yet subtle differences exist in petal shape, color, and markings, making accurate differentiation extremely difficult. Currently, orchid variety identification primarily relies on the experience of professional horticultural experts, but the limited number of experts and the long cultivation cycle make it difficult to meet the urgent needs of large-scale cultivation for variety identification. Manual identification is not only inefficient and highly subjective, but external factors such as the orchid's growth period, environment, and light can also alter its appearance, further increasing the complexity of identification. Therefore, there is an urgent need for an automated, efficient, and low-cost orchid identification method to replace traditional manual experience-based identification.

[0003] In recent years, deep learning technology has made significant progress in the field of image recognition, and researchers have applied it to the automated identification of orchid varieties. Early representative methods include: Sarachai et al. constructed a two-stream architecture containing a global prediction network and a local prediction network, and introduced a spatial transformation network to automatically locate key regions, achieving an accuracy of 93.32% on the Orchids-52 dataset (W. Sarachai et al., 2019); Arwatchananukul achieved a recognition rate of 98.6% on 15 species of Paphiopedilum based on Inception-v3 transfer learning (S. Arwatchananukul, et al., 2020); Ou proposed a soft voting ensemble method that achieved an accuracy of 95.13% on the Orchids-52 dataset (C.-H. Ou. et al., 2023); Wang et al. captured petal texture and edge semantic information by fusing convolutional features at different levels, achieving an accuracy of 92.98% on 12 species (J. Wang et al., 2024). Chinese invention patent CN112966738A discloses a method and system for identifying Cymbidium species based on convolutional neural networks and transfer learning. The method uses the Inception-ResNet-v2 network to extract Cymbidium images, and constructs an identification model through ImageNet pre-training and model-based transfer learning. It achieves an identification accuracy of 91.51% on a self-built Cymbidium dataset. This patent verifies the effectiveness of deep convolutional neural networks combined with transfer learning in orchid identification.

[0004] Furthermore, the quality and size of orchid datasets directly limit the performance ceiling of recognition models. Early representative datasets include the Orchids-52 Dataset built by a Thai research team in 2019, containing 3,559 orchid images of 52 varieties; the Orchid Flowers Dataset released by the University of Twente in the Netherlands in 2020, containing 7,156 images covering 156 orchid varieties; and the Orchid2024 dataset built by a Chinese research team in 2024, containing 156,630 images covering 1,275 varieties. However, existing datasets face the following main challenges: first, except for Orchid2024, most datasets have fewer than 10,000 images; second, the growth stages are not fully covered, mainly focusing on flowering period images and lacking data on leaves outside the flowering period; third, images crawled from the web have cluttered backgrounds and inconsistent quality; and fourth, datasets specifically for identifying leaves outside the flowering period are still lacking.

[0005] In summary, while the aforementioned methods have made significant progress in orchid identification, most studies focus on identifying images from the "flowering period," heavily relying on flower images. However, orchids are in their non-flowering period for more than 10 months of the year, retaining only highly similar leaves. Traditional flower-feature-based models perform poorly in this scenario. Existing deep learning-based plant identification patents (such as CN118447390A) have verified the feasibility of lightweight networks in plant leaf identification, but are mainly geared towards general leaf classification tasks; CN108564589A has achieved high-precision leaf segmentation, but does not involve variety identification; CN112966738A targets orchid species identification, but focuses on flowers as the primary identification object and does not introduce fine-grained feature mining strategies. Currently, research on orchid non-flowering leaf identification is still in its early stages, lacking large-scale standardized datasets and targeted fine-grained algorithms. Therefore, how to establish a high-precision automatic orchid variety identification method based on subtle local differences in non-flowering leaves and construct a corresponding high-quality non-flowering leaf dataset has become an urgent technical problem to be solved.

[0006] To address the aforementioned issues, this invention proposes an orchid leaf recognition method based on multi-granularity spatial disorder and mutual contrastive learning (MCL-MGSCNet). Using MobileNetV3-Large as the backbone network, the method disrupts the macroscopic structure of the image through a multi-granularity spatial disorder module to guide the model to focus on local discriminative features such as leaf veins and textures. At the same time, the method utilizes a mutual contrastive learning mechanism to enhance the intra-class compactness and inter-class separability of the feature space. Furthermore, a high-quality dataset of orchid leaves during the non-flowering period is constructed to overcome the shortcomings of existing technologies. Summary of the Invention

[0007] (a) Technical problems to be solved

[0008] This invention provides a method for orchid leaf recognition based on multi-granularity spatial disorder and mutual comparison learning, aiming to solve the following technical problems:

[0009] (1) There is currently no dataset of orchid leaves outside the flowering period, and there is a lack of high-quality standardized datasets for model training and evaluation.

[0010] (2) Existing orchid variety identification methods rely heavily on flower images during the flowering period and lack the ability to identify leaf images during the non-flowering period. The macroscopic outlines of orchid leaves during the non-flowering period are highly similar, and the core differences are only reflected in local subtle features such as leaf veins and textures. Traditional identification methods based on global features are difficult to capture such fine-grained discriminative features.

[0011] (II) Technical Solution

[0012] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0013] A method for orchid leaf recognition based on multi-granularity spatial disorder and mutual contrast learning, such as... Figure 1 This includes the following steps:

[0014] Step 1: Obtain an image of the orchid leaf to be identified.

[0015] Step 2: Input the orchid leaf image into the multi-granularity spatial disorder module, perform multi-granularity block division and local window random rearrangement on the input image to generate the original natural view and multiple spatially perturbed views of different granularities.

[0016] The multi-granularity spatial disorder module is used to perform multi-granularity block division and random rearrangement of local windows on the input image to destroy the macroscopic spatial structure of the image, guide the model to focus on local discrimination features such as leaf veins, textures, and spots, thereby improving the ability to distinguish similar orchid varieties.

[0017] For the input feature tensor Define a granularity set G = {2, 4, 7}. For any chosen granularity g ∈ G, adaptively adjust the image size to a size divisible by g. ,in ;

[0018] The adjusted image is divided into g×g sub-blocks, each sub-block having a size of g. ;

[0019] A pairwise random swapping strategy based on local window constraints is adopted, restricting the displacement range of each sub-block to a neighborhood window centered on itself, and randomly swapping the positions of sub-blocks. Specifically, a Boolean occupancy matrix S of size g×g is maintained to mark whether the current sub-block has participated in the position swapping; all sub-blocks are traversed in row and column order, and for unmarked sub-blocks... Collect all unlabeled candidate blocks within a rectangular neighborhood centered on the sub-block with radius w; the row range of the candidate blocks is... The column range is A target block is randomly selected uniformly from the candidate set and its contents are swapped. The two sub-blocks are then marked as swapped. If the candidate set is empty, the current sub-block remains in its original position.

[0020] The rearranged sub-blocks are stitched together and cropped back to their original size to obtain a spatially perturbed view at this granularity. The output consists of the original image and multiple perturbed image versions at different granularities, forming a multi-granularity feature set. .

[0021] Preferably, the granularity set is G={4,7}, and the local window limit radius is w=1. Ablation experiments show that accuracy drops when the granularity is too fine (e.g., G=14), indicating that overly fragmented image patches will disrupt the semantic continuity of leaf veins; when the window radius w=1, the best balance is achieved between "destroying global contours" and "preserving local texture spatial correlation".

[0022] Step 3: Input the original natural view and multiple spatial perturbation views of different granularities into two branches of the dual-branch network architecture. The dual-branch network architecture includes two branch networks, Model A and Model B, with MobileNetV3-Large as the backbone network for each branch network. The backbone network of each branch network extracts high-level semantic features from the original natural view and the spatial perturbation view respectively.

[0023] Preferably, the backbone network MobileNetV3-Large extracts 1280-dimensional high-level semantic features. .

[0024] Step 4: Each branch network maps the high-level semantic features to a low-dimensional embedding vector through its own projection head.

[0025] The projection head is a two-layer multilayer perceptron that maps the 1280-dimensional high-level semantic features extracted by the backbone network to a 128-dimensional low-dimensional embedding vector. And batch normalization and Dropout are integrated into the intermediate layer, defined as:

[0026]

[0027] in , , This is the ReLU activation function.

[0028] Step 5: Constrain the original view features and perturbed view features within each branch network using visual contrast loss, bringing similar sample features closer together and pushing away dissimilar sample features.

[0029] The visual contrast loss constrains feature invariance within a single network: regardless of how the orchid image is scrambled by a multi-granularity spatial disorder module, the class-specific discrimination representation should remain consistent. For anchor sample i in the current batch, its features are: Let A(i) be the set of all samples except i in the current batch. Samples of the same type as the anchor sample constitute the positive sample set P(i), and the rest constitute the negative sample set.

[0030] The visual contrast loss is defined as:

[0031]

[0032] in, Let I be the temperature coefficient, and let I represent the set of all sample indices in the current batch that can be used as anchor points. Similarly, calculate the visual contrast loss of Model B. Total visual contrast loss .

[0033] Step 6: Apply bidirectional constraints to the feature space between the two branch networks using interactive contrastive loss to bring the feature representations of the same image closer together.

[0034] The interactive contrastive loss is used to bring the feature representations of the same image closer together between the two networks, preventing a single model from getting stuck on biased features. Using the feature space of network A... For anchor points, the feature space of network B The cross-model supervised comparison loss for the comparison set is:

[0035]

[0036] in, Let represent the set of positive samples with the same class label as anchor sample i. By swapping the roles of the anchor and the contrast set, we obtain the inverse constraint loss. The interactive contrast loss is the sum of bidirectional cross-model supervision constraints:

[0037]

[0038] Step 7: The orchid identification result is output by the classifier.

[0039] In practical applications, the total training loss function of the recognition model is:

[0040]

[0041] in, For classifying losses, To compare learning losses, These are dynamic weighting coefficients.

[0042] The classification loss This represents the mean of the dual-network classification loss. The single-network classification loss comprises the cross-entropy loss of the original view and the augmentation classification loss of the perturbed view.

[0043]

[0044] The overall classification loss of the dual network is:

[0045]

[0046] The dynamic weighting coefficient Employing a preheating and sinusoidal half-cycle decay strategy:

[0047]

[0048] Where t is the current training round, and T=50 is the total number of training rounds. This is a warm-up round. This serves as the initial comparison weighting benchmark. Ablation experiments show that when... The time-limited model achieved the best performance of 95.15%.

[0049] Furthermore, the training process described in this invention employs the Adam optimizer, with an initial learning rate of... The batch size is 64, the number of training rounds is 50, and the input image is cropped to 224×224.

[0050] Preferably, the reasoning phase of the recognition model uses only the original image as input and does not use spatially perturbed views.

[0051] In practical applications, the process also includes constructing a training dataset: Orchid leaf images are collected on-site at orchid cultivation bases, and professional institutions identify the varieties. All images are taken against a single dark background, capturing leaf texture and plant shape from multiple angles with precise focus. The dataset is divided according to plant independence: different plants of the same variety are randomly assigned to the training, validation, and test sets in a 6:2:2 ratio, ensuring zero overlap between the training, validation, and test sets in terms of physical plants.

[0052] (III) Beneficial Effects

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] (1) This invention constructs a dedicated non-flowering orchid leaf recognition dataset (Guangdong Orchid Dataset) for the task of identifying orchid leaves during the non-flowering period. It contains 56,118 images, covering 6 orchid species and 22 varieties, involving 329 individual plants, filling a data gap in this field. The dataset adopts a plant-independent partitioning method to ensure that the training set, validation set and test set have zero overlap in physical plants, which can more objectively evaluate the model's ability to learn common features of varieties and its cross-individual generalization performance.

[0055] (2) This invention proposes a Multi-Granularity Spatial Disorder Module (MGSC), which actively disrupts the macroscopic spatial structure of the image through multi-granularity block division and random rearrangement of local windows, guiding the model to focus on local stable discriminative features such as leaf veins, textures, and spots. Ablation experiments show that after introducing the MGSC module, the model accuracy increased from 93.03% to 94.20%, an improvement of 1.17 percentage points, verifying the effectiveness of the spatial perturbation strategy in mining local detailed features.

[0056] (3) This invention proposes a Mutual Comparison Learning (MCL) mechanism, which constructs visual contrast loss and interactive contrast loss based on a dual-network architecture to enhance the intra-class compactness and inter-class separability of the feature space. Ablation experiments show that after further introducing the MCL mechanism on the basis of the MGSC module, the model accuracy is improved from 94.20% to 95.15%, an improvement of 0.95 percentage points, proving that the MCL mechanism and the MGSC module form a good complementary advantage.

[0057] (4) The overall performance of the method of this invention is superior to that of many existing models. Experimental results show that the method of this invention achieves a maximum accuracy of 95.15% under the condition of 9.91M parameters, which is better than the comparison models such as ResNet18 (93.76%), MobileNetV3-Large (93.03%), VGG16 (92.71%), ViT-B / 16 (92.41%), LoRA-QVKO (94.86%), ECTFormer (92.61%), and MSANet (94.54%). Compared with the baseline MobileNetV3-Large, the accuracy is improved by 2.12 percentage points, which verifies the effectiveness of the method of this invention in the task of identifying orchid leaves during the non-flowering period.

[0058] (5) The method of the present invention enables the model to focus on the subtle local differences of leaves through the synergistic effect of multi-granularity spatial disorder modules and mutual comparison learning mechanism. It can achieve high-precision orchid variety identification by relying solely on leaf images during the non-flowering period, effectively solving the practical problems of lack of flower characteristics and difficulty in manual identification of orchids during the non-flowering period. It provides an effective technical solution for intelligent orchid planting management, variety resource protection and automated species identification. Attached Figure Description

[0059] Figure 1 This is a schematic diagram of the orchid growth cycle according to the present invention;

[0060] Figure 2 Examples of images of some varieties of orchid leaves in the Guangdong orchid leaf dataset of this invention;

[0061] Figure 3 This is a hierarchical distribution map of species and varieties of orchid leaves in Guangdong Province, based on the dataset of this invention.

[0062] Figure 4 This is a histogram showing the distribution of the number of images of each orchid variety in the Guangdong orchid leaf dataset of this invention.

[0063] Figure 5 This is a comparison chart showing the average number of images collected per plant for each species in the Guangdong orchid leaf dataset of this invention;

[0064] Figure 6 This is a diagram showing the overall architecture of the MCL-MGSCNet model of this invention;

[0065] Figure 7 This is a schematic diagram of the multi-granularity spatial disorder module structure of the present invention;

[0066] Figure 8 This is a visualization example of spatially confused samples under different granularities and windows according to the present invention;

[0067] Figure 9 This is a diagram illustrating the overall framework of the mutual comparison learning mechanism of this invention. Detailed Implementation

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0069] This embodiment proposes an orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning, which can effectively improve the fine-granular recognition performance of orchid leaves during the non-flowering period. Figure 6 ,include:

[0070] Acquire images of orchid leaves to be identified;

[0071] The orchid leaf image is input into a pre-trained recognition model, and the variety recognition result is output.

[0072] in, Figure 6 This is a schematic diagram of the overall architecture of the MCL-MGSCNet model provided by the present invention, as shown below. Figure 6 As shown, the method of the present invention includes: inputting an orchid leaf image; generating an original natural view and multiple spatially perturbed views of different granularities through a multi-granularity spatial disorder module (MGSC); extracting features through a dual-branch network architecture (Model A and Model B); performing collaborative feature learning through a mutual contrastive learning mechanism (MCL); and outputting orchid variety identification results.

[0073] In practical applications, the training method for the recognition model is as follows:

[0074] First, a training dataset was constructed. Field photography was conducted at the National Orchid Base in Wengyuan County, Guangdong Province, with variety identification performed in collaboration with the Institute of Environmental Horticulture, Guangzhou Academy of Agricultural Sciences. The data acquisition process followed a standardized procedure: all images were captured against a single dark background to reduce environmental background noise interference; multi-angle capture (eye-level and side views) was used to assess the leaf texture and overall plant shape of the orchids, ensuring precise focus. Two smartphones were used uniformly for data acquisition: a Xiaomi 14 Pro and a vivo X200s, to cover the color distribution differences caused by different imaging sensors.

[0075] The orchid dataset (Guangdong Orchid Dataset) constructed in this manner contains 56,118 images, covering 6 orchid species and 22 varieties, involving 329 individual plants. The dataset exhibits a clear "species-variety" secondary structure in its classification hierarchy. Cymbidium ensifolium and Cymbidium goeringii are the two species with the largest data volume, accounting for approximately 31% and 29% respectively, followed by hybrid orchids (15%), Cymbidium faberi (10%), Cymbidium sinense (9%), and Cymbidium kanran (5%). Each variety has over a thousand images, sufficient to meet the needs of model training.

[0076] The dataset was partitioned based on plant independence: different plants of the same variety were randomly assigned to the training, validation, and test sets in a 6:2:2 ratio. For example, for a variety containing 10 independent plants, all images of 6 plants were randomly selected for the training set, images of 2 plants were used for the validation set, and images of the remaining 2 plants were used for the test set. This partitioning method ensures zero overlap between the training, validation, and test sets in terms of physical plants, preventing the model from "memorizing" the accidental features of specific plants and more objectively evaluating the model's ability to learn common features of the variety and its cross-individual generalization performance.

[0077] In practical applications, the design of the Multi-Granularity Spatial Chaotic Module (MGSC) is as follows:

[0078] The multi-granularity spatial disorder module actively erases the macroscopic shape features of an image by scrambling its spatial structure, forcing the model to focus on stable, fine-grained local information at multiple scales, thereby improving its ability to distinguish similar varieties. For example... Figure 7 As shown, after the image is divided into several small blocks, the module randomly shuffles the positions of these image blocks in a local perturbation manner, which destroys the continuity of the overall contour and texture and weakens the model's dependence on simple structural cues such as leaf-shaped contours.

[0079] For the input feature tensor Define the granularity set G = {2, 4, 7}. For any selected granularity g ∈ G, the module first performs adaptive size adjustment:

[0080] ;

[0081] in, This indicates rounding up. Then, bilinear interpolation is used to... Adjusted to It was then divided into There are 1 sub-blocks. The size of each sub-block is 1. .

[0082] To strike a balance between "destroying the global outline" and "preserving local texture spatial correlation," a pairwise random swapping strategy based on local window constraints is adopted. Specifically, a Boolean occupancy matrix S of size g×g is maintained to mark whether the current sub-block has participated in the position swap; all sub-blocks are traversed in row and column order, and for unmarked sub-blocks... Collect all unlabeled candidate blocks within a rectangular neighborhood centered on the sub-block with radius w; the row range of the candidate blocks is... The column range is A target block is randomly selected uniformly from the candidate set and its contents are swapped. The two sub-blocks are then marked as swapped. If the candidate set is empty, the current sub-block remains in its original position.

[0083] The rearranged sub-blocks are then pieced together. Then crop back to the original size. Repeat the above process for each granularity g, and output a multi-granularity feature set. .

[0084] like Figure 7 As shown, when the window radius w is small, each sub-block can only undergo a small displacement at its immediate neighboring position, preserving the spatial correlation of local texture; as w increases, the perturbation range expands accordingly, and the global structure is more severely damaged.

[0085] Preferably, the granularity set G = {4, 7}, and the local window limit radius w = 1. Ablation experiments show that accuracy drops when the granularity is too fine (e.g., G = 14), indicating that overly fragmented image patches can disrupt the semantic continuity of leaf veins; when the window radius w = 1, the optimal balance is achieved between "destroying global contours" and "preserving local texture spatial correlation", as shown in Tables 1 and 2.

[0086] In practical applications, the design of the Mutual Comparison Learning (MCL) mechanism is as follows:

[0087] The aforementioned mutual comparison learning mechanism aims to enhance the intra-class compactness and inter-class separability of the feature space, addressing the problem of blurred boundaries in fine-grained recognition. For example... Figure 8As shown, MCL relies on a dual-network architecture (Model A and Model B) to process the original natural view ( ) and the spatial perturbation view generated by the MGSC module ( Perform cograph feature learning.

[0088] Original natural view and multi-granularity perturbation view The inputs are fed into Model A and Model B, and the backbone network MobileNetV3-Large extracts 1280-dimensional high-level semantic features. A non-linear projection head is introduced to map it to a 128-dimensional embedding vector:

[0089]

[0090] in , , The activation function is ReLU. The projection head is a two-layer multilayer perceptron, with batch normalization and Dropout incorporated in the middle layer.

[0091] The Visual Contrast Loss (VCL) constrains feature invariance within a single network: regardless of how the orchid image is shuffled by MGSC, the class-specific discrimination representation should remain consistent. For anchor sample i in Model A, its features are... Visual contrast loss is defined as:

[0092]

[0093] in, Let I be the temperature coefficient, and let A(i) represent the set of all sample indices in the current batch that can serve as anchor points. Let A(i) represent the set of all samples in the current batch excluding anchor sample i, and let P(i) represent the set of positive samples of the same type as the anchor sample. Similarly, calculate the visual contrast loss of Model B. Total visual contrast loss .

[0094] The Interactive Contrast Loss (ICL) brings the feature representations of the same image closer together between the two networks, preventing a single model from getting stuck on biased features. Using the feature space of network A... For anchor points, the feature space of network B The cross-model supervised comparison loss for the comparison set is:

[0095]

[0096] in, Let represent the set of positive samples with the same class label as anchor sample i. By swapping the roles of the anchor and the contrast set, we obtain the inverse constraint loss. The interactive contrast loss is the sum of bidirectional cross-model supervision constraints:

[0097]

[0098] In practical applications, the total training loss function of the recognition model is:

[0099]

[0100] in, For classifying losses, To compare learning losses, These are dynamic weighting coefficients.

[0101] The classification loss This represents the mean of the dual-network classification loss. The single-network classification loss comprises the cross-entropy loss of the original view and the augmentation classification loss of the perturbed view.

[0102]

[0103] The overall classification loss of the dual network is:

[0104]

[0105] The dynamic weighting coefficient Employing a preheating and sinusoidal half-cycle decay strategy:

[0106]

[0107] Where t is the current training round, and T=50 is the total number of training rounds. This is a warm-up round. The initial contrastive weights serve as the baseline. This strategy ensures that the model does not incorporate contrastive learning in the first 10 epochs of training, focusing instead on the initial construction of the main classification features. In the mid-stage, the contrastive learning weights smoothly climb to their peak, emphasizing narrowing the gap between similar classes and widening the boundaries between dissimilar classes in the feature space. In the later stages of training, the weights smoothly decline, prompting the network to shift its optimization focus to precise fine-tuning of the main classification surface, achieving an optimal balance between feature representation robustness and classification accuracy. Ablation experiments show that when... The model achieved the best performance of 95.15%, as shown in Table 5.

[0108] Preferably, the training process uses the Adam optimizer with an initial learning rate of The batch size is 64, the number of training rounds is 50, and the input image is cropped to 224×224.

[0109] Preferably, the inference phase of the recognition model uses only the original image as input and does not use spatially perturbated views. The orchid leaf image to be recognized is input into the trained model, and the variety recognition result is output.

[0110] In practical applications, to verify the effectiveness of the method of the present invention, ablation experiments and comparative experiments were conducted on a self-built Guangdong orchid leaf dataset.

[0111] (1) MGSC granularity ablation experiment. Table 1 shows the experimental results for different MGSC granularities. After introducing the multi-granularity spatial disorder module, the model accuracy was generally improved. In single-granularity perturbation, G=7 reached the highest 94.02%; in multi-granularity combination, G={4,7} reached the optimal 94.20%; when the granularity was too fine (such as G=14), the accuracy dropped back to 93.82%, indicating that overly fragmented image patches would destroy the semantic continuity of leaf veins.

[0112] Table 1. Experimental results for different MGSC particle sizes

[0113] MobileNetV3-Large 93.03 +MGSC(G=2) 93.39 +MGSC(G=4) 93.55 +MGSC(G=7) 94.02 +MGSC(G=14) 93.82 +MGSC(G=2,4) 93.63 +MGSC(G=4,7) 94.20 +MGSC(G=2,7) 94.17 +MGSC(G=2,4,7) 93.49

[0114] (2) Window size ablation experiment. Table 2 shows the experimental results with different window size restrictions. The best result of 94.20% was achieved when the window radius w=1; as w increased to 3, the accuracy dropped to 93.90%, indicating that an excessively large perturbation window would excessively disrupt the semantic continuity of local textures.

[0115] Table 2 Experimental results with different window sizes

[0116] MGSC(G=4,7;w=1) 94.20 MGSC(G=4,7;w=2) 93.99 MGSC(G=4,7;w=3) 93.90

[0117] (3) Synergistic ablation experiment of MGSC and MCL. Table 3 shows the ablation experiment results of the core module. The accuracy of the baseline model was 93.03%; it improved to 94.20% (+1.17%) after adding MGSC alone; and reached 95.15% (+0.95%) after further introducing MCL, which proved the effective synergy of the two modules.

[0118] Table 3. Results of MGSC and MCL ablation experiments

[0119] √ × × 93.03 √ √ × 94.20 √ √ √ 95.15

[0120] (4) Internal loss ablation experiment of MCL. Table 4 shows the contribution of each loss function in MCL. With MobileNetV3-Large+MGSC as the baseline (94.20%), it is improved to 94.74% (+0.54%) when only the visual contrast loss VCL is used; at the same time, when the interactive contrast loss ICL is incorporated to form a complete MCL, it reaches 95.15% (+0.95% from the baseline).

[0121] Table 4 Results of ablation experiments for various losses within the MCL

[0122] √ × × 94.20 √ √ × 94.74 √ √ √ 95.15

[0123] (5) Initial weight analysis. Table 5 shows the experimental results for different initial comparison weights. When As the weight is gradually increased from 0.1 to 0.6, the accuracy shows an upward trend and reaches a peak of 95.15% at 0.6. When the weight is further increased, the accuracy drops, indicating that excessively strong contrast loss constraints may destroy the linearly separable feature surface of the backbone network.

[0124] Table 5 Initial Weights analyze

[0125] 0.1 94.59 0.2 94.42 0.3 94.68 0.4 94.71 0.5 94.83 0.6 95.15 0.7 94.81 0.8 94.97 0.9 94.93 1.0 94.87

[0126] (6) Comparative experiments with existing methods. Table 6 shows the performance comparison of different models on the Guangdong orchid leaf dataset. The method of this invention achieved a maximum accuracy of 95.15% with 9.91M parameters, which is better than the comparison models such as ResNet18 (93.76%), MobileNetV3-Large (93.03%), VGG16 (92.71%), ViT-B / 16 (92.41%), LoRA-QVKO (94.86%), ECTFormer (92.61%), MSANet (94.54%) and GCM-EDCNet (88.93%).

[0127] Table 5 Performance comparison of different models on the Guangdong orchid leaf dataset

[0128] ResNet18 (K.He et al., 2016) 11.19 93.76 MobileNetV3-Large (A.Howard et al., 2019) 4.23 93.03 VGG16 (K. Simonyan et al., 2015) 134.35 92.71 ViT-B / 16 (A. Dosovitskiy et al., 2010) 85.82 92.41 LoRA-QVKO (Y. Peng et al., 2024) 86.11 94.86 ECTFormer

[40] (J. Sa et al., 2024) 9.10 92.61 MSANet

[41] (P. Zhao et al., 2025) 73.89 94.54 GCM-EDCNet (M. Li et al., 2026) 0.65 88.93 MCL-MGSCNet (This invention) 9.91 95.15

[0129] The experimental results above show that the method of the present invention achieves a good balance between recognition accuracy and model complexity, and verifies its effectiveness in the task of identifying orchid leaves during the non-flowering period.

[0130] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for orchid leaf recognition based on multi-granularity spatial disorder and mutual comparison learning, characterized in that, Includes the following steps: (1) Obtain an image of the orchid leaf to be identified; (2) The input image is processed by a multi-granularity spatial disorder module to generate an original natural view and multiple spatially perturbed views of different granularities; (3) Input the original natural view and the spatially perturbed view into the two branches of the dual-branch network architecture to extract image features; (4) Feature learning is performed on the original image view and the spatially perturbed view through a mutual comparison learning mechanism; (5) The orchid identification result is output by the classifier. The multi-granularity spatial disorder module is used to perform multi-granularity block division and random rearrangement of local windows on the input image to generate multiple spatial perturbation views of different granularities, so as to guide the model to focus on local discriminative features such as leaf veins and textures. The dual-branch network architecture includes Model A and Model B, with each branch network using MobileNetV3-Large as its backbone network. High-level semantic features are extracted from the backbone network of each branch network, and then mapped to low-dimensional embedding vectors through their respective projection heads. The mutual contrast learning mechanism is used to learn features from the original image view and the spatially perturbed view. It uses visual contrast loss to bring together features of similar samples and push away features of dissimilar samples, and uses interactive contrast loss to impose bidirectional constraints on the feature space between the two branch networks, thereby bringing the feature representations of the same image closer together by the two networks.

2. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 1, characterized in that, It also includes the steps of building the dataset: (1) Orchid leaf images were taken on-site at the orchid planting base and identified by a professional institution. All images were taken against a single dark background, and the leaf texture and plant shape were captured from multiple angles and precisely focused. (2) The dataset is divided according to plant independence: different plants of the same variety are randomly assigned to the training set, validation set and test set in a ratio of 6:2:2 to ensure that the training set, validation set and test set have zero overlap on physical plants.

3. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 1, characterized in that, The multi-granularity spatial disorder module processes the input image in the following manner: (1) For the input feature tensor Define the granularity set G={2,4,7}; (2) For any selected granularity g∈G, the image size is adaptively adjusted to a size that is divisible by g. ,in ; (3) Divide the adjusted image into g×g sub-blocks, each sub-block having a size of g×g. ; (4) A pairwise random exchange strategy based on local window constraints is adopted to limit the displacement range of each sub-block to a neighborhood window centered on itself, and the sub-block positions are randomly exchanged. (5) The rearranged sub-blocks are spliced ​​together and cut back to their original size to obtain a spatial perturbation view at this granularity; (6) Output a multi-granularity feature set consisting of the original image and multiple perturbation-perfected image versions. .

4. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 3, characterized in that, The specific pairwise random swapping strategy for the local window constraint is as follows: (1) Maintain a Boolean occupancy matrix S of size g×g to mark whether the current sub-block has participated in the position swap; (2) Traverse all sub-blocks in row and column order. For unmarked sub-blocks... Collect all unlabeled candidate blocks within a rectangular neighborhood centered on the sub-block and with radius w; (3) The row range of the candidate block is The column range is ; (4) Randomly select a target block from the candidate set and swap its contents, then mark the two sub-blocks as swapped. If the candidate set is empty, the current sub-block remains in its original position.

5. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 1, characterized in that, The mutual comparison learning mechanism is implemented based on a dual-network architecture, including two branch networks, Model A and Model B; the backbone networks of the dual-network architecture are both based on MobileNetV3-Large and are each connected to an independent projection head.

6. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 5, characterized in that, The projection head is a two-layer multilayer perceptron that maps 1280-dimensional high-level semantic features extracted by the backbone network to 128-dimensional low-dimensional embedding vectors, and incorporates batch normalization and Dropout in the intermediate layer.

7. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 5, characterized in that, The visual contrast loss is defined as follows: For anchor sample i in the current batch, its characteristics are: Let A(i) be the set of all samples except i in the current batch. Samples of the same type as the anchor sample constitute the positive sample set P(i), and the rest constitute the negative sample set. The visual contrast loss is: in, Let I be the temperature coefficient, and let I represent the set of all sample indices in the current batch that can be used as anchor points; similarly, calculate the visual contrast loss of Model B. Total visual contrast loss .

8. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 7, characterized in that, The temperature coefficient .

9. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 5, characterized in that, The interactive contrast loss is defined as follows: Using the feature space of network A For anchor points, the feature space of network B The cross-model supervised comparison loss for the comparison set is: in, This represents the set of positive samples that have the same category label as anchor sample i; By swapping the roles of the anchor point and the comparison set, we obtain the inverse constraint loss. ; The interactive contrast loss is the sum of bidirectional cross-model supervision constraints:

10. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 5, characterized in that, The total training loss function of the recognition model is: in, For classifying losses, To compare learning losses, These are dynamic weighting coefficients.

11. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 10, characterized in that, The classification loss The mean of the classification loss for the two networks: The single-network classification loss consists of the cross-entropy loss of the original view and the augmented classification loss of the perturbed view: The overall classification loss of the dual network is:

12. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 10, characterized in that, The dynamic weighting coefficient Employing a preheating and sinusoidal half-cycle decay strategy: Where t is the current training round, and T is the total number of training rounds. This is a warm-up round. This serves as the initial comparison weight benchmark.

13. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 12, characterized in that, The total number of training rounds T=50, including the number of pre-training warm-up rounds. Initial comparison weight benchmark .

14. The orchid leaf recognition method based on multi-granularity spatial disorder and mutual comparison learning according to claim 1, characterized in that, The reasoning phase of the recognition model uses only the original image as input and does not use spatially perturbated views.

Citation Information

Patent Citations

  • Improved convolutional neural network-based plant leaf segmentation method

    CN108564589A

  • Chinese cymbidium type identification method and system based on convolutional neural network and transfer learning

    CN112966738A

  • Lightweight convolutional neural network-based plant leaf identification method and device

    CN118447390A