Seed mat species classification analysis method and system based on neural network model

Through the seed felt species classification analysis method based on neural network model, combined with multi-scale pyramid pooled convolutional neural network and gated cyclic unit long and short-term memory network, the problems of low efficiency and strong subjectivity of seed species classification in the existing technology are solved, and higher classification accuracy and robustness are achieved.

CN119339248BActive Publication Date: 2025-04-08KEXIN (TIANJIN) ECOLOGICAL AGRI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411886568.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-08
Estimated Expiration
2044-12-20

Smart Images

  • Figure CN119339248B_ABST
    Figure CN119339248B_ABST
Patent Text Reader

Abstract

The invention provides a seed felt species classification analysis method and system based on a neural network model, which relates to the technical field of agricultural management, and comprises the following steps: obtaining a high-definition digital image of a seed felt sample, extracting a single seed region in the seed felt, obtaining a binary mask image of the seed through contour extraction and morphological filtering, and constructing a seed image data set; constructing a multi-scale pyramid pooling convolutional neural network, and based on the seed image data set, extracting seed morphological features through progressive feature map upsampling and cross-layer feature fusion; inputting the seed morphological features into a gated recurrent unit long short-term memory network, and establishing a mapping relationship between a seed morphological feature sequence and a species category; fusing the multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network, constructing a plurality of independent species classifiers, and constructing a classification decision model, and inputting the seed felt to be classified into the classification decision model to determine the seed felt species.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of agricultural management, and in particular to a seed felt species classification analysis method and system based on a neural network model. Background Art

[0002] Seeds are important materials for plant reproduction and agricultural production. Accurate identification and classification of seed species are of great significance for agricultural research and production practice. Traditional seed species classification mainly relies on manual observation and empirical judgment, which has problems such as low efficiency and strong subjectivity. With the development of computer vision and artificial intelligence technology, automatic classification of seed images using machine learning algorithms has become a new research direction.

[0003] Existing seed species classification methods still have some limitations. Traditional machine learning methods based on manual feature extraction rely on prior knowledge and experience for feature design and selection, and it is difficult to fully explore the rich information in seed images. Although deep learning-based methods can automatically learn features, for fine-grained classification tasks such as seed images, it may be difficult to capture the subtle differences between seed species using only a single-scale feature representation.

[0004] In summary, existing methods usually use a single classifier for decision-making and lack the integration and optimization of multiple classifiers, which limits the further improvement of classification performance. Therefore, the present invention can solve the problems in the prior art by fully exploring the seed morphological characteristics, capturing multi-scale feature representations, and improving the accuracy and robustness of classification by integrating the decisions of multiple classifiers. Summary of the invention

[0005] The embodiment of the present invention provides a seed felt species classification analysis method and system based on a neural network model, which can solve the problems in the prior art.

[0006] According to a first aspect of the embodiments of the present invention,

[0007] A seed felt species classification analysis method based on a neural network model is provided, including:

[0008] Obtain high-definition digital images of seed felt samples, use adaptive threshold segmentation algorithm to preprocess the images, extract single seed regions in the seed felt, obtain binary mask images of seeds through contour extraction and morphological filtering, and construct a seed image dataset;

[0009] Based on the pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image data set, the high-dimensional feature map is restored on the spatial scale through progressive feature map upsampling and cross-layer feature fusion, and features at different abstract levels are integrated to extract seed morphological features; the seed morphological features are input into the gated recurrent unit long short-term memory network, the state of the memory unit is dynamically adjusted through the gating mechanism, the dependency of the seed morphological features in the time dimension is determined, and the mapping relationship between the seed morphological feature sequence and the species category is established;

[0010] The multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated, and multiple independent species classifiers are constructed based on the mapping relationship between seed morphological feature sequences and species categories. Based on the ensemble learning strategy of adaptive weights, the weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt.

[0011] In an optional embodiment,

[0012] Obtain high-definition digital images of seed felt samples, use adaptive threshold segmentation algorithm to preprocess the images, extract single seed areas in the seed felt, obtain binary mask images of seeds through contour extraction and morphological filtering, and construct seed image datasets based on the appearance morphological characteristics of seeds, including:

[0013] Acquire a high-definition digital image of a seed felt sample, and preprocess the high-definition digital image, wherein the preprocessing includes local contrast enhancement and adaptive threshold segmentation, wherein the local contrast enhancement is based on an adaptive histogram equalization algorithm, the high-definition digital image is divided into a plurality of sub-regions, histogram equalization is performed on each sub-region, the local region contrast is calculated, the pixel value is adaptively changed, and the contrast difference between the seed and the background is adjusted, the adaptive threshold segmentation is based on the local mean and standard deviation of the high-definition digital image, the segmentation threshold is determined based on the local mean and standard deviation, the high-definition digital image is binarized, the pixel value corresponding to the seed region is set to 1, the pixel value corresponding to the background region is set to 0, and a binarized image is determined;

[0014] A single seed is extracted based on the binary image, the geometric center of the seed area is used as the seed point, and the region growing method is used based on the similarity of pixel values ​​and the spatial adjacency relationship. After iteration, the adjacent pixel points are merged into the seed area to obtain a preliminary segmented single seed area, and the initial contour is determined. Based on the level set method, by minimizing the energy functional, combined with the pre-determined seed circularity constraint and seed compactness constraint, the boundary corresponding to the initial contour is adjusted to extract the single seed target area;

[0015] The single seed target area is subjected to contour extraction and morphological filtering. Based on the gradient Canny operator, the single seed target area is subjected to edge detection to obtain seed contour information. The seed contour information is subjected to opening and closing operations to determine a smooth seed boundary, determine a binary mask image corresponding to the seed, annotate the seed samples based on the binary mask image, and construct a seed image dataset.

[0016] In an optional embodiment,

[0017] Based on the pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image dataset, through progressive feature map upsampling and cross-layer feature fusion, the high-dimensional feature map is restored on the spatial scale, and features at different abstract levels are integrated to extract seed morphological features including:

[0018] ResNet-50 is used as the base network, the fully connected layer in the base network is removed, and a global average pooling layer and a 256-dimensional fully connected layer are added after the last convolution block to generate a fine-tuned network;

[0019] The attention learning module is introduced, which takes the original feature map output by the last convolutional block as input and generates a four-dimensional attention weight vector through global average pooling and two fully connected layers;

[0020] Based on the original feature map, four adaptive-scale average pooling layers are applied to pool the original feature map into spatial resolutions of 1×1, 2×2, 3×3, and 6×6, and four scale pooling feature maps are determined;

[0021] Based on the four-dimensional attention weight vector, four scale pooling feature maps are weightedly fused to obtain an adaptive multi-scale feature map;

[0022] Based on the adaptive multi-scale feature map, the pooled feature maps corresponding to the 1×1, 2×2 and 3×3 scales are restored to the same size as the original feature map through upsampling operations, and aligned in the spatial dimension using bilinear interpolation to obtain an aligned feature map;

[0023] Through the lightweight attention module, we learn to align the importance of different regions in the feature map and generate a spatial attention weight map.

[0024] Multiplying the spatial attention weight map with the corresponding aligned feature map to obtain an attention-enhanced feature representation, and fusing the attention-enhanced feature representations corresponding to different scales through element-level weighting to obtain a multi-scale fused feature map;

[0025] Based on the multi-scale fusion feature map, the number of channels is reduced to 256 dimensions through a 1×1 convolution layer, and the spatial dimension features corresponding to the multi-scale fusion feature map are compressed into a 256-dimensional seed morphological feature vector through global average pooling to extract the seed morphological features.

[0026] In an optional embodiment,

[0027] Inputting the seed morphological features into the gated recurrent unit long short-term memory network, dynamically adjusting the state of the memory unit through the gating mechanism, determining the dependency of the seed morphological features in the time dimension, and establishing the mapping relationship between the seed morphological feature sequence and the species category include:

[0028] Based on the seed morphological features, a multi-scale window is set according to a plurality of preset scales, and the multi-scale window and the corresponding step size are slid on the seed morphological features, and the continuous feature vectors in each sliding window constitute a seed morphological feature sequence, so as to construct a seed morphological feature sequence of multiple scales;

[0029] Based on the seed morphological feature sequence at each scale, combined with a multi-head self-attention module, the seed morphological feature sequence is mapped to a query matrix, a key matrix, and a value matrix through a linear transformation, and the corresponding attention weights are calculated. The self-attention enhanced seed morphological feature sequence is determined through weighted summation;

[0030] The self-attention enhanced seed morphological feature sequence at each scale is input into the corresponding gated recurrent unit long short-term memory network, and the hidden state is dynamically adjusted by updating the gate, resetting the gate and the memory unit to capture the corresponding long-distance dependencies in the time dimension at different scales;

[0031] On the hidden state sequence of the gated recurrent unit long short-term memory network at each scale, combined with the pre-built temporal attention module, by aggregating hidden states from different time steps, a temporal attention encoding representation at the corresponding scale is obtained;

[0032] The temporal attention coding representation at each scale is mapped to a shared feature space through a fully connected layer, and the feature dimensions are aligned to obtain an aligned coding representation. The importance weights of representations at different scales are learned through a pre-built scale attention module, and the final multi-scale seed morphology feature sequence coding is obtained through weighted fusion;

[0033] The final multi-scale seed morphological feature sequence encoding is input into a pre-built classifier, and the probability distribution of species categories is calculated through a fully connected layer and a softmax function. The gated recurrent unit long short-term memory network is trained end-to-end in combination with a cross-entropy loss function and a back-propagation algorithm to establish a mapping relationship between the seed morphological feature sequence and the species category.

[0034] In an optional embodiment,

[0035] After determining the self-attention enhanced seed morphological feature sequence, the final multi-scale seed morphological feature sequence encoding is obtained, which also includes:

[0036] Based on the self-attention enhanced seed morphological feature sequence, combined with the gated memory network, the long-term dependency of the self-attention enhanced seed morphological feature sequence is dynamically stored and updated through the memory matrix, and the corresponding memory information reading, writing and forgetting are controlled through the gating mechanism to obtain the gated memory result;

[0037] Based on the gated memory result, combined with the residual self-attention module, the corresponding internal dependency relationship is modeled through the multi-head self-attention mechanism, the internal attention output result is determined, and the internal attention output result is residually connected with the seed morphological feature sequence at the corresponding scale to obtain the residual self-attention seed morphological feature sequence;

[0038] Based on the residual self-attention seed morphological feature sequence, encoding is performed through a gated recurrent unit to capture the corresponding evolution law in the time dimension, and obtain the seed morphological feature sequence encoding at the corresponding scale;

[0039] The seed morphological feature sequences at different scales are encoded and fused through a multi-scale interactive attention module, and the correlation and importance between different scales are adaptively learned through interactive calculations of a query matrix, a key matrix, and a value matrix to obtain a multi-scale interactive attention encoding;

[0040] Based on the multi-scale interactive attention coding and combined with an adaptive fusion gating unit, the contribution of seed morphological feature sequence coding of different scales is adaptively adjusted through a gating mechanism, and weighted fused with the multi-scale interactive attention coding to obtain the final multi-scale seed morphological feature sequence coding.

[0041] In an optional embodiment,

[0042] The multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated to construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. Based on the ensemble learning strategy of adaptive weights, the weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function to construct a classification decision model including:

[0043] Based on the species classifier, the corresponding confidence, diversity and complementarity are determined to generate weight coefficients. Based on the multi-layer perceptron, the weight coefficients are iteratively adjusted through nonlinear transformation and parameter learning to determine the adaptive weight generation function.

[0044] Based on a predetermined dynamic selection mechanism, multiple optimal species classifiers are selected from multiple species classifiers through seed morphological characteristics combined with an adaptive weight generation function, and a classification decision model is constructed by adjusting the combination and weight distribution of the optimal species classifiers.

[0045] The classification decision model decomposes the seed species classification process into multiple stages according to a preset number of stages, inputs the seed morphological characteristics into the first-stage species classifier, obtains preliminary classification results according to preset major categories, and inputs the preliminary classification results into the second-stage species classifier for confirmation and classification to obtain the seed felt species classification results.

[0046] According to a second aspect of the embodiments of the present invention,

[0047] A seed felt species classification analysis system based on a neural network model is provided, comprising:

[0048] The first unit is used to obtain high-definition digital images of seed felt samples, pre-process the images using an adaptive threshold segmentation algorithm, extract the single seed area in the seed felt, obtain the binary mask image of the seed through contour extraction and morphological filtering, and construct a seed image dataset;

[0049] The second unit is used to introduce a pyramid pooling structure based on a pre-trained deep convolutional neural network, construct a multi-scale pyramid pooling convolutional neural network, and based on the seed image data set, restore the high-dimensional feature map on a spatial scale through progressive feature map upsampling and cross-layer feature fusion, integrate features at different abstract levels, and extract seed morphological features; input the seed morphological features into a gated recurrent unit long short-term memory network, dynamically adjust the state of the memory unit through a gating mechanism, determine the dependency of the seed morphological features in the time dimension, and establish a mapping relationship between the seed morphological feature sequence and the species category;

[0050] The third unit is used to integrate the multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network, and construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. The weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt.

[0051] According to a third aspect of the embodiments of the present invention,

[0052] An electronic device is provided, comprising:

[0053] processor;

[0054] a memory for storing processor-executable instructions;

[0055] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0056] A fourth aspect of the embodiments of the present invention is:

[0057] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0058] In the embodiments of the present invention, a single seed region is accurately extracted by combining region growing and level set methods, thereby improving the accuracy and completeness of extraction; contour extraction and morphological filtering are used to eliminate noise, smooth boundaries, and obtain a high-quality binary mask image; a seed image dataset containing a variety of appearance morphological features is constructed to enhance the diversity and robustness of the dataset; more samples are generated through image enhancement technology to further improve the generalization ability of the model; a pyramid pooling structure is introduced to effectively extract and integrate seed morphological features of different scales through a multi-scale pyramid pooling convolutional neural network model to enhance the richness and expression ability of features; and through progressive feature map upsampling and cross-layer feature fusion, Restoring high-dimensional feature maps on a spatial scale and integrating features at different levels of abstraction enhances the model's ability to capture complex seed morphologies; constructing multiple independent species classifiers enables specialized learning and classification of features of different seed species, improving the professionalism and classification accuracy of the classifiers; an integrated learning strategy based on adaptive weights dynamically adjusts the weight coefficients of each species classifier through a nonlinear mapping function, which can optimize the combination of classifiers according to the needs of the classification task and improve the flexibility and adaptability of the classification decision model; by integrating multiple classifiers and adjusting the weights, the constructed classification decision model has higher robustness and discrimination, and can more accurately determine the seed mat species. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic diagram of the process of the seed felt species classification analysis method based on the neural network model according to an embodiment of the present invention;

[0060] Figure 2 It is a structural schematic diagram of a seed felt species classification and analysis system based on a neural network model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0063] Figure 1 FIG. 4 is a flow chart of a method for classifying and analyzing seed felt species based on a neural network model according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0064] S101. Obtain a high-definition digital image of a seed felt sample, pre-process the image using an adaptive threshold segmentation algorithm, extract a single seed region in the seed felt, obtain a binary mask image of the seed by contour extraction and morphological filtering, and construct a seed image dataset;

[0065] In this embodiment, high-definition image acquisition provides rich details and enhances the accuracy of segmentation and feature extraction; the adaptive threshold segmentation algorithm dynamically adjusts the threshold to improve the accuracy and robustness of seed region segmentation; extracting a single seed region reduces noise and irrelevant information, simplifying subsequent feature extraction and analysis; contour extraction and morphological filtering obtain precise and smooth seed boundaries, ensuring the quality of the binary mask image; the binary mask image clearly distinguishes the seed region from the background, simplifying subsequent calculations; and constructing a seed image dataset provides a diverse and high-quality data source for machine learning and scientific research.

[0066] In an optional embodiment, a high-definition digital image of a seed felt sample is obtained, an adaptive threshold segmentation algorithm is used to pre-process the image, a single seed region in the seed felt is extracted, a binary mask image of the seed is obtained by contour extraction and morphological filtering, and a seed image data set is constructed according to the appearance morphological features of the seed, including:

[0067] Acquire a high-definition digital image of a seed felt sample, and preprocess the high-definition digital image, wherein the preprocessing includes local contrast enhancement and adaptive threshold segmentation, wherein the local contrast enhancement is based on an adaptive histogram equalization algorithm, the high-definition digital image is divided into a plurality of sub-regions, histogram equalization is performed on each sub-region, the local region contrast is calculated, the pixel value is adaptively changed, and the contrast difference between the seed and the background is adjusted, the adaptive threshold segmentation is based on the local mean and standard deviation of the high-definition digital image, the segmentation threshold is determined based on the local mean and standard deviation, the high-definition digital image is binarized, the pixel value corresponding to the seed region is set to 1, the pixel value corresponding to the background region is set to 0, and a binarized image is determined;

[0068] A single seed is extracted based on the binary image, the geometric center of the seed area is used as the seed point, and the region growing method is used based on the similarity of pixel values ​​and the spatial adjacency relationship. After iteration, the adjacent pixel points are merged into the seed area to obtain a preliminary segmented single seed area, and the initial contour is determined. Based on the level set method, by minimizing the energy functional, combined with the pre-determined seed circularity constraint and seed compactness constraint, the boundary corresponding to the initial contour is adjusted to extract the single seed target area;

[0069] The single seed target area is subjected to contour extraction and morphological filtering. Based on the gradient Canny operator, the single seed target area is subjected to edge detection to obtain seed contour information. The seed contour information is subjected to opening and closing operations to determine a smooth seed boundary, determine a binary mask image corresponding to the seed, annotate the seed samples based on the binary mask image, and construct a seed image dataset.

[0070] Obtain high-definition digital images of seed felt samples. Use a high-resolution digital camera to shoot the seed felt samples to obtain clear, unobstructed digital images. During the shooting process, it is necessary to ensure that the camera is parallel to the surface of the seed felt and the lighting conditions are consistent to avoid the influence of shadows and reflections. At the same time, in order to facilitate subsequent processing, the background of the image should be a pure color material that is significantly different from the color of the seeds.

[0071] The adaptive threshold segmentation algorithm is combined with local contrast enhancement for image preprocessing. First, the image is locally contrast enhanced. By calculating the contrast in the local area of ​​the image, the pixel value is adaptively adjusted to enhance the contrast difference between the seed and the background. Specifically, the adaptive histogram equalization algorithm is used to divide the image into multiple sub-areas, and each sub-area is subjected to histogram equalization to improve the local contrast. Then, the adaptive threshold segmentation algorithm is applied to the enhanced image, and the segmentation threshold is adaptively determined according to the local mean and standard deviation to binarize the image. By combining local contrast enhancement with adaptive threshold segmentation, the separation effect of the seed and the background is effectively improved.

[0072] Combine region growing and level set methods to extract single seeds. In the obtained binary image, the geometric center of the seed region is used as the seed point, and the region growing method is applied to preliminarily segment the single seed region. During the region growing process, adjacent pixels are iteratively merged into the seed region according to the similarity of pixel values ​​and spatial adjacency until there are no pixels that meet the conditions. The result of region growing is used as the initial contour, and the level set method is applied to further optimize the boundary of the seed. The level set method minimizes the energy functional so that the contour continues to evolve and gradually approaches the true boundary of the seed. During the evolution process, shape prior constraints are introduced. Preferably, circularity constraints, compactness constraints, etc. of the seeds are selected to ensure that the extracted seed region has reasonable shape characteristics. By combining region growing with the level set method, the limitations of a single method are overcome and the accuracy and completeness of single seed extraction are improved.

[0073] The binary mask image of the seed is obtained by contour extraction and morphological filtering. For the extracted single seed area, the contour extraction algorithm is used to obtain the outer boundary contour of the seed. Specifically, the gradient-based Canny operator is used for edge detection to obtain the contour information of the seed. The extracted contour is subjected to morphological filtering operations, such as opening and closing operations, to eliminate noise and small depressions in the contour and smooth the boundary of the seed. Through contour extraction and morphological filtering, a binary mask image of the seed is obtained, in which the pixel value of the seed area is 1 and the pixel value of the background area is 0.

[0074] A seed image dataset is constructed based on the appearance morphological features of seeds. For each extracted seed binary mask image, the appearance morphological features of the seeds, such as length, width, perimeter, area, texture, etc., are extracted using an image processing algorithm. The length and width of the seeds are calculated using the regional moment method, the perimeter and area of ​​the seeds are obtained by pixel counting, and the texture features of the seeds are extracted using the gray-level co-occurrence matrix. According to the extracted morphological features, the seed samples are labeled and classified. In order to enhance the diversity and robustness of the dataset, image enhancement technology is used, preferably rotation, translation, scaling, and noise addition, to generate more seed image samples. Finally, the labeled seed images, the corresponding binary mask images, the extracted morphological features, and the label information are organized into a structured seed image dataset for subsequent feature analysis and classification experiments.

[0075] In this embodiment, high-definition images ensure the clarity and details of samples and provide reliable basic data; local contrast enhancement improves the distinction between seeds and background and improves image quality; an adaptive threshold segmentation algorithm improves the separation effect of seeds and background and reduces segmentation errors; combining region growing and level set methods, a single seed region is accurately extracted to improve the accuracy and completeness of extraction; contour extraction and morphological filtering eliminate noise, smooth boundaries, and obtain a high-quality binary mask image; a seed image dataset containing a variety of appearance morphological features is constructed to enhance the diversity and robustness of the dataset; more samples are generated through image enhancement technology to further improve the generalization ability of the model; and it is organized into a structured dataset to facilitate subsequent feature analysis and classification experiments, supporting more accurate seed recognition and classification.

[0076] S102. Based on the pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image data set, the high-dimensional feature map is restored on a spatial scale through progressive feature map upsampling and cross-layer feature fusion, and features at different abstract levels are integrated to extract seed morphological features; the seed morphological features are input into a gated recurrent unit long short-term memory network, the state of the memory unit is dynamically adjusted through a gating mechanism, the dependency of the seed morphological features in the time dimension is determined, and a mapping relationship between the seed morphological feature sequence and the species category is established;

[0077] In this embodiment, a pyramid pooling structure is introduced, and seed morphological features of different scales are effectively extracted and integrated through a multi-scale pyramid pooling convolutional neural network model, thereby improving the richness and expression ability of features; through progressive feature map upsampling and cross-layer feature fusion, high-dimensional feature maps are restored on a spatial scale, and features at different levels of abstraction are integrated, thereby enhancing the model's ability to capture complex seed morphologies; seed morphological features are input into a gated recurrent unit long short-term memory network, and the state of the memory unit is dynamically adjusted using a gating mechanism, thereby accurately capturing the dependency of seed morphological features in the time dimension, thereby improving the temporal modeling capability of feature sequences; by establishing a mapping relationship between seed morphological feature sequences and species categories, accurate classification of seed species is achieved, thereby improving the accuracy and practicality of the classification model.

[0078] In an optional embodiment, based on a pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image dataset, through progressive feature map upsampling and cross-layer feature fusion, a high-dimensional feature map is restored on a spatial scale, and features at different abstraction levels are integrated. Extracting seed morphological features includes:

[0079] ResNet-50 is used as the base network, the fully connected layer in the base network is removed, and a global average pooling layer and a 256-dimensional fully connected layer are added after the last convolution block to generate a fine-tuned network;

[0080] The attention learning module is introduced, which takes the original feature map output by the last convolutional block as input and generates a four-dimensional attention weight vector through global average pooling and two fully connected layers;

[0081] Based on the original feature map, four adaptive-scale average pooling layers are applied to pool the original feature map into spatial resolutions of 1×1, 2×2, 3×3, and 6×6, and four scale pooling feature maps are determined;

[0082] Based on the four-dimensional attention weight vector, four scale pooling feature maps are weightedly fused to obtain an adaptive multi-scale feature map;

[0083] Based on the adaptive multi-scale feature map, the pooled feature maps corresponding to the 1×1, 2×2 and 3×3 scales are restored to the same size as the original feature map through upsampling operations, and aligned in the spatial dimension using bilinear interpolation to obtain an aligned feature map;

[0084] Through the lightweight attention module, we learn to align the importance of different regions in the feature map and generate a spatial attention weight map.

[0085] Multiplying the spatial attention weight map with the corresponding aligned feature map to obtain an attention-enhanced feature representation, and fusing the attention-enhanced feature representations corresponding to different scales through element-level weighting to obtain a multi-scale fused feature map;

[0086] Based on the multi-scale fusion feature map, the number of channels is reduced to 256 dimensions through a 1×1 convolution layer, and the spatial dimension features corresponding to the multi-scale fusion feature map are compressed into a 256-dimensional seed morphological feature vector through global average pooling to extract the seed morphological features.

[0087] Select ResNet-50 as the base network and remove the fully connected layer in the base network. After the last convolution block, add a global average pooling layer and a 256-dimensional fully connected layer to form a fine-tuning network. The global average pooling layer is used to compress the feature map output by the last convolution block into a 256-dimensional feature vector, while the 256-dimensional fully connected layer is used to map the feature vector to the target dimensional space to generate the fine-tuned feature representation.

[0088] The attention learning module is introduced, and the original feature map output by the last convolutional block is used as input. A four-dimensional attention weight vector is generated through a global average pooling layer and two fully connected layers. The global average pooling layer compresses the spatial dimension information of the original feature map into a feature vector, and the two fully connected layers are used to learn the attention weights. The first fully connected layer maps the feature vector to a high-dimensional space to enhance the expressiveness of the features, and the second fully connected layer maps the high-dimensional features into a four-dimensional attention weight vector, where each dimension corresponds to a scale weight.

[0089] Based on the original feature map, four average pooling layers of adaptive scales are applied to pool the original feature map into spatial resolutions of 1×1, 2×2, 3×3, and 6×6, respectively, to obtain four pooled feature maps of different scales. The average pooling operation divides the feature map into regions of different sizes and averages the feature values ​​in each region to achieve feature downsampling and scale transformation. Pooling operations of different scales can capture feature information of different granularities and enhance the multi-scale representation capability of features.

[0090] Based on the four-dimensional attention weight vector, the four scale pooling feature maps are weighted fused. Each dimension of the attention weight vector is multiplied by the pooling feature map of the corresponding scale to obtain the attention-enhanced scale feature map. Then, the four attention-enhanced scale feature maps are added together to obtain an adaptive multi-scale feature map. The role of the attention weight vector is to adaptively adjust the contribution of different scale feature maps according to the importance of the feature, so that more important scale features obtain higher weights and improve the discriminability of feature representation.

[0091] Based on the adaptive multi-scale feature map, the pooled feature maps corresponding to the 1×1, 2×2 and 3×3 scales are restored to the same size as the original feature map through upsampling operations. The feature maps of different scales are aligned in the spatial dimension by bilinear interpolation to obtain the aligned feature map. The upsampling operation restores the low-resolution feature map to high resolution by interpolation, realizing the alignment and fusion of features of different scales. Bilinear interpolation can smoothly estimate unknown pixel values ​​and maintain the continuity and spatial structure of features.

[0092] Through a lightweight attention module, the importance of different regions in the aligned feature map is learned and a spatial attention weight map is generated. The attention module extracts the spatial dependencies of the aligned feature map through a series of convolution and pooling operations, and generates a spatial attention weight map of the same size as the original feature map. Each element of the spatial attention weight map represents the importance of the feature at the corresponding position. The larger the value, the greater the contribution of the region to the final feature representation.

[0093] The spatial attention weight map is multiplied with the corresponding aligned feature map to obtain the attention-enhanced feature representation. Through element-level multiplication operations, the spatial attention weight map is applied to each position of the aligned feature map to achieve feature enhancement in the spatial dimension. The attention-enhanced feature representation can highlight the features of important areas, suppress the interference of background and irrelevant areas, and improve the discriminability and robustness of features.

[0094] The attention-enhanced feature representations corresponding to different scales are weightedly fused at the element level to obtain a multi-scale fused feature map. The fusion operation achieves multi-scale integration of features by adding the attention-enhanced feature representations of different scales. The multi-scale fused feature map can take into account feature information of different granularities and improve the richness and robustness of feature representation.

[0095] Based on the multi-scale fusion feature map, the number of feature channels is reduced to 256 dimensions through a 1×1 convolution layer. The 1×1 convolution layer performs a linear transformation on the feature vector of each pixel position through point-by-point convolution to achieve compression and adjustment of the feature dimension. The feature map after dimensionality reduction retains important feature information while reducing computational complexity.

[0096] Perform global average pooling on the 256-dimensional feature map to compress the spatial dimension features into a 256-dimensional feature vector to obtain the final seed morphology feature vector. Global average pooling encodes the spatial information into a compact feature representation by averaging all spatial positions of the feature map to extract the global features of the seed morphology. This feature vector can be used for subsequent tasks such as seed classification and recognition.

[0097] In this embodiment, by introducing an attention learning module and a multi-scale pooling operation, the weights of feature maps of different scales are adaptively adjusted to enhance the expressiveness and discriminability of the features; by combining pooling features of different scales and an attention mechanism, multi-scale fusion of features is achieved, seed morphological information of different granularities is captured, and the richness and robustness of feature representation are improved; by upsampling and bilinear interpolation operations, spatial alignment of features of different scales is achieved, the continuity of features and the consistency of spatial structure are ensured, and the feature fusion effect is improved; by 1×1 convolutional layer dimensionality reduction and global average pooling, important feature information is retained, while the dimension and computational complexity of the features are significantly reduced, thereby improving the operating efficiency of the model; by using the attention weight map, the feature representation of important areas is enhanced, the interference of background and irrelevant areas is suppressed, the discriminability and robustness of features are improved, and the accuracy of classification and recognition is improved.

[0098] In an optional embodiment, the seed morphological features are input into a gated recurrent unit long short-term memory network, the state of the memory unit is dynamically adjusted through a gating mechanism, the dependency of the seed morphological features in the time dimension is determined, and the mapping relationship between the seed morphological feature sequence and the species category is established, including:

[0099] Based on the seed morphological features, a multi-scale window is set according to a plurality of preset scales, and the multi-scale window and the corresponding step size are slid on the seed morphological features, and the continuous feature vectors in each sliding window constitute a seed morphological feature sequence, so as to construct a seed morphological feature sequence of multiple scales;

[0100] Based on the seed morphological feature sequence at each scale, combined with a multi-head self-attention module, the seed morphological feature sequence is mapped to a query matrix, a key matrix, and a value matrix through a linear transformation, and the corresponding attention weights are calculated. The self-attention enhanced seed morphological feature sequence is determined through weighted summation;

[0101] The self-attention enhanced seed morphological feature sequence at each scale is input into the corresponding gated recurrent unit long short-term memory network, and the hidden state is dynamically adjusted by updating the gate, resetting the gate and the memory unit to capture the corresponding long-distance dependencies in the time dimension at different scales;

[0102] On the hidden state sequence of the gated recurrent unit long short-term memory network at each scale, combined with the pre-built temporal attention module, by aggregating hidden states from different time steps, a temporal attention encoding representation at the corresponding scale is obtained;

[0103] The temporal attention coding representation at each scale is mapped to a shared feature space through a fully connected layer, and the feature dimensions are aligned to obtain an aligned coding representation. The importance weights of representations at different scales are learned through a pre-built scale attention module, and the final multi-scale seed morphology feature sequence coding is obtained through weighted fusion;

[0104] The final multi-scale seed morphological feature sequence encoding is input into a pre-built classifier, and the probability distribution of species categories is calculated through a fully connected layer and a softmax function. The gated recurrent unit long short-term memory network is trained end-to-end in combination with a cross-entropy loss function and a back-propagation algorithm to establish a mapping relationship between the seed morphological feature sequence and the species category.

[0105] Based on the extracted seed morphological features, sliding windows of multiple scales are set according to the preset multiple scales. Each scale corresponds to a window of a specific size and a corresponding step size. The seed morphological features are slid in the form of a sliding window, and the step size of each slide corresponds to the window size. During the sliding process, the continuous feature vectors in each sliding window constitute a seed morphological feature sequence. Through sliding windows of different scales, seed morphological feature sequences at multiple scales can be obtained to capture sequence features of different granularities.

[0106] For the seed morphological feature sequence obtained at each scale, a multi-head self-attention module is introduced for feature enhancement. The seed morphological feature sequence is mapped to the query matrix, key matrix and value matrix respectively through linear transformation. The attention weight matrix is ​​obtained by calculating the dot product of the query matrix and the key matrix. The attention weight matrix represents the correlation and importance between features at different positions in the sequence. The attention weight matrix is ​​multiplied by the value matrix and weighted summed to obtain the seed morphological feature sequence enhanced by self-attention. The multi-head self-attention module captures the internal dependencies of the sequence from different subspaces through multiple independent attention heads to enhance the expressiveness of the features.

[0107] The self-attention enhanced seed morphological feature sequences obtained at each scale are input into the corresponding gated recurrent unit long short-term memory network. The hidden state is dynamically adjusted through the update gate, reset gate and memory unit to capture the long-distance dependency of the sequence in the time dimension. The update gate controls the update degree of the hidden state, the reset gate determines the degree of forgetting of historical information, and the memory unit stores long-term sequence information. Through the recurrent structure, the temporal evolution process of the seed morphological feature sequence can be effectively modeled and a high-level sequence feature representation can be extracted.

[0108] A temporal attention module is introduced to aggregate temporal features on the hidden state sequence output by the gated recurrent unit long short-term memory network at each scale. The temporal attention module adaptively aggregates information from different time steps by learning the importance weights of hidden states at different time steps. Specifically, the hidden state sequence is mapped to the attention weight space through a fully connected layer, and the attention weight of each time step is calculated. The attention weight is multiplied by the hidden state of the corresponding time step, and the weighted sum is performed to obtain the temporal attention encoding representation at this scale. The temporal attention mechanism can highlight important time step features, suppress noise and redundant information, and improve the discriminability of sequence features.

[0109] The temporal attention encoding representation obtained at each scale is mapped to the shared feature space through a fully connected layer to achieve alignment of feature dimensions of representations at different scales. The mapped feature representation is called the aligned encoding representation, which has the same feature dimension. The scale attention module is introduced to learn the importance weights of representations at different scales. The aligned encoding representation is mapped to the scale weight space through a fully connected layer, and the attention weight of each scale is calculated. Then, the attention weight is multiplied by the aligned encoding representation of the corresponding scale, and the weighted sum is performed to obtain the final multi-scale seed morphological feature sequence encoding. The scale attention mechanism can adaptively fuse feature information of different scales, highlight the contribution of important scales, and improve the robustness of feature representation.

[0110] The obtained multi-scale seed morphological feature sequence encoding is input into the pre-built classifier for seed species classification. The classifier maps the feature encoding to the probability space of species categories through a fully connected layer, and then calculates the probability distribution of each category through the softmax function. In the training stage, the cross entropy loss function is used as the objective function to measure the difference between the predicted probability distribution and the true species label. Through the back-propagation algorithm, the gradient of the loss function is passed to the network, and the network parameters are optimized end-to-end to establish the mapping relationship between the seed morphological feature sequence and the species category. After sufficient training, the classifier can effectively map the seed morphological feature sequence to the corresponding species category.

[0111] In this embodiment, a multi-scale sliding window method is used to capture different granularity information of seed morphological features, and enhance the diversity and detail expression of features; a multi-head self-attention module is introduced to effectively capture the dependencies within sequence features, enhance the expressiveness of features, and improve the model's understanding and representation of features; a gated recurrent unit long short-term memory network is used to dynamically adjust hidden states, capture long-distance dependencies, effectively model the temporal evolution process of seed morphological feature sequences, and extract high-level feature representations; the temporal attention module can adaptively aggregate important time step feature information, suppress noise and redundancy, and improve the discriminability and robustness of features; the dimensional alignment of feature representations of different scales is achieved through a fully connected layer, and the contribution of important scales is highlighted in combination with a scale attention module, and multi-scale feature information is further integrated to enhance the integrity and robustness of feature representation; the multi-scale seed morphological feature sequence is encoded and input into a classifier, and the network parameters are optimized in combination with a cross entropy loss and a back propagation algorithm to establish an accurate mapping relationship between seed morphological features and species categories, thereby improving the accuracy and automation of seed species classification.

[0112] In an optional embodiment, after determining the self-attention enhanced seed morphological feature sequence, obtaining the final multi-scale seed morphological feature sequence encoding further includes:

[0113] Based on the self-attention enhanced seed morphological feature sequence, combined with the gated memory network, the long-term dependency of the self-attention enhanced seed morphological feature sequence is dynamically stored and updated through the memory matrix, and the corresponding memory information reading, writing and forgetting are controlled through the gating mechanism to obtain the gated memory result;

[0114] Based on the gated memory result, combined with the residual self-attention module, the corresponding internal dependency relationship is modeled through the multi-head self-attention mechanism, the internal attention output result is determined, and the internal attention output result is residually connected with the seed morphological feature sequence at the corresponding scale to obtain the residual self-attention seed morphological feature sequence;

[0115] Based on the residual self-attention seed morphological feature sequence, encoding is performed through a gated recurrent unit to capture the corresponding evolution law in the time dimension, and obtain the seed morphological feature sequence encoding at the corresponding scale;

[0116] The seed morphological feature sequences at different scales are encoded and fused through a multi-scale interactive attention module, and the correlation and importance between different scales are adaptively learned through interactive calculations of a query matrix, a key matrix, and a value matrix to obtain a multi-scale interactive attention encoding;

[0117] Based on the multi-scale interactive attention coding and combined with an adaptive fusion gating unit, the contribution of seed morphological feature sequence coding of different scales is adaptively adjusted through a gating mechanism, and weighted fused with the multi-scale interactive attention coding to obtain the final multi-scale seed morphological feature sequence coding.

[0118] For the self-attention enhanced seed morphological feature sequence obtained at each scale, a gated memory network (GMN) is introduced to model long-term dependencies. GMN dynamically stores and updates the long-term information of the sequence through an external memory matrix, and controls the reading, writing and forgetting of memory information through a gating mechanism. Specifically, the self-attention enhanced feature sequence is gradually input into the GMN, and the degree of fusion of the input features and historical memory information at the current time step is determined by the update gate, the writing strength of the new memory information is controlled by the write gate, and the degree of forgetting of the historical memory information is controlled by the forget gate. Through the iterative update process of GMN, the long-term dependencies in the seed morphological feature sequence can be captured and stored, and the feature representation enhanced by gated memory can be obtained.

[0119] On the basis of the feature representation enhanced by gated memory, the residual self-attention module (RSAM) is introduced to further enhance the expressiveness of the features. RSAM models the dependencies within the feature sequence through a multi-head self-attention mechanism to capture the correlation and importance between features at different positions. Specifically, the feature sequence enhanced by gated memory is mapped to multiple subspaces through linear transformation, which are respectively used as the query matrix, key matrix and value matrix. Then, by calculating the dot product of the query matrix and the key matrix, the self-attention weight matrix is ​​obtained, which represents the attention distribution between different positions within the sequence. Next, the self-attention weight matrix is ​​multiplied by the value matrix to obtain the self-attention weighted feature representation. Finally, the self-attention weighted feature representation is residually connected to the original seed morphological feature sequence to obtain the seed morphological feature sequence enhanced by residual self-attention. The introduction of residual connection can prevent network degradation and promote the propagation of gradients.

[0120] For the seed morphological feature sequence enhanced by residual self-attention, the gated recurrent unit (GRU) is used for sequence encoding. GRU dynamically adjusts the hidden state through the update gate and reset gate to capture the evolution law of the sequence in the time dimension. The update gate controls the update degree of the hidden state, and the reset gate determines the degree of forgetting of historical information. Through the recurrent structure of GRU, the temporal dependency of the seed morphological feature sequence can be effectively modeled, and the seed morphological feature sequence encoding at the corresponding scale can be obtained. The feature representation encoded by GRU has stronger temporal expression ability and discrimination.

[0121] In order to make full use of the complementarity and correlation between multi-scale features, a multi-scale interactive attention module (MSIAM) is introduced to fuse the seed morphological feature sequence encodings at different scales. MSIAM adaptively learns the correlation and importance between different scales through interactive calculations of query matrix, key matrix and value matrix. Specifically, the feature sequence encodings at different scales are used as query matrix, key matrix and value matrix respectively, and the interaction weights between them are calculated through the attention mechanism. Then, the interaction weights are multiplied by the value matrix to obtain the feature representation of the attention weight between scales. Finally, the attention weighted features of different scales are spliced ​​to obtain the multi-scale interactive attention encoding. MSIAM realizes information interaction and fusion between scales by modeling the association between features of different scales, thereby improving the richness and robustness of feature representation.

[0122] On the basis of multi-scale interactive attention coding, an adaptive fusion gating unit (AFGU) is introduced to adaptively fuse features of different scales. AFGU adaptively adjusts the contribution of feature coding of different scales through the gating mechanism, and performs weighted fusion with multi-scale interactive attention coding. Specifically, the multi-scale interactive attention coding and the seed morphological feature sequence coding at different scales are input into AFGU respectively, and the fusion weight of each scale is calculated by the sigmoid function. Then, the fusion weight is multiplied by the feature coding of the corresponding scale to obtain the weighted scale feature. Finally, the weighted scale feature is element-wise added to the multi-scale interactive attention coding to obtain the final multi-scale seed morphological feature sequence coding. AFGU dynamically adjusts the importance of features of different scales through adaptive weight allocation, realizes optimized fusion between scales, and improves the discriminability and generalization ability of feature representation.

[0123] In this embodiment, by introducing a gated memory network, the long-term dependencies in the seed morphological feature sequence can be effectively captured and stored, and the temporal consistency and accuracy of the feature representation can be enhanced; the residual self-attention module enhances the expressiveness of the feature sequence through a multi-head self-attention mechanism and residual connections, prevents network degradation, promotes gradient propagation, and improves the discriminative power of the feature; the gated recurrent unit is used for sequence encoding, which can dynamically adjust the hidden state, capture the temporal dependencies of the sequence, and enhance the temporal expression ability of the feature representation; the multi-scale interactive attention module realizes information interaction and fusion between scales by modeling the association between features of different scales, thereby increasing the richness and robustness of the feature representation; the adaptive fusion gating unit dynamically adjusts the importance of features of different scales through adaptive weight allocation, realizes optimized fusion between scales, and improves the discriminative power and generalization ability of the feature representation.

[0124] S103. The multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated to construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. The weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt.

[0125] In this embodiment, by fusing a multi-scale pyramid pooling convolutional neural network and a gated recurrent unit long short-term memory network, the information of seed morphological features at different scales can be effectively captured and utilized, thereby improving the comprehensiveness and accuracy of feature representation; by constructing multiple independent species classifiers, the characteristics of different seed species can be specifically learned and classified, thereby improving the professionalism and classification accuracy of the classifiers; based on an integrated learning strategy with adaptive weights, the weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function, thereby optimizing the combination of classifiers according to the needs of the classification task, thereby improving the flexibility and adaptability of the classification decision model; by integrating multiple classifiers and adjusting the weights, the constructed classification decision model has higher robustness and discrimination, and can more accurately determine the seed mat species; the design of the overall process significantly improves the accuracy and reliability of seed mat classification through the fusion of multi-level, multi-scale and multi-classifiers.

[0126] In an optional embodiment, the multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated, and multiple independent species classifiers are constructed based on the mapping relationship between the seed morphological feature sequence and the species category. The weight coefficient of each species classifier is dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights, and the classification decision model is constructed, including:

[0127] Based on the species classifier, the corresponding confidence, diversity and complementarity are determined to generate weight coefficients. Based on the multi-layer perceptron, the weight coefficients are iteratively adjusted through nonlinear transformation and parameter learning to determine the adaptive weight generation function.

[0128] Based on a predetermined dynamic selection mechanism, multiple optimal species classifiers are selected from multiple species classifiers through seed morphological characteristics combined with an adaptive weight generation function, and a classification decision model is constructed by adjusting the combination and weight distribution of the optimal species classifiers.

[0129] The classification decision model decomposes the seed species classification process into multiple stages according to a preset number of stages, inputs the seed morphological characteristics into the first-stage species classifier, obtains preliminary classification results according to preset major categories, and inputs the preliminary classification results into the second-stage species classifier for confirmation and classification to obtain the seed felt species classification results.

[0130] For multiple trained species classifiers, their corresponding confidence, diversity and complementarity are determined to generate initial weight coefficients. Confidence reflects the degree of certainty of the classifier's classification results for seed species, which can be measured by the entropy value of the probability distribution output by the classifier. Diversity measures the differences between different classifiers, which can be measured by calculating the dissimilarity between the classifier's prediction results. Complementarity indicates the degree of complementarity of different classifiers on misclassified samples, which can be evaluated by analyzing the overlap of misclassified samples by the classifier. Based on these indicators, an initial weight coefficient is generated for each classifier as the starting point for subsequent weight optimization.

[0131] A multi-layer perceptron is introduced to adaptively adjust the initial weight coefficients and generate the optimal weight distribution. Through nonlinear transformation and parameter learning, the mapping relationship between the weight coefficients and confidence, diversity and complementarity is established. Specifically, confidence, diversity and complementarity are used as input features, and the generating function of the weight coefficients is learned through nonlinear transformation of multiple hidden layers. During the training process, the parameters are optimized through the back propagation algorithm to minimize the difference between the weight coefficients and the ideal weights. After iterative optimization, the weight coefficients are adaptively adjusted according to the performance indicators of the classifier to obtain the optimal weight generating function.

[0132] Based on a predetermined dynamic selection mechanism, the classifier combination with the best performance is selected from multiple species classifiers. The dynamic selection mechanism comprehensively considers the seed morphological characteristics and the weight coefficients of the classifiers, and adaptively selects the optimal classifier combination. Specifically, for a given seed morphological feature, the weight coefficient of each classifier is calculated by an adaptive weight generation function. According to the size of the weight coefficient, a classifier combination with high confidence, strong diversity and good complementarity is selected. By dynamically adjusting the classifier combination and weight distribution, the optimal classification decision model is constructed. This decision model can flexibly select the most suitable classifier combination according to the different seed morphological characteristics, thereby improving the accuracy and adaptability of classification.

[0133] Construct a staged seed species classification decision model, decompose the classification process into multiple stages, and gradually refine the classification results. According to the preset number of stages, the seed species classification process is divided into a preliminary classification stage and a confirmation classification stage. In the preliminary classification stage, the seed morphological characteristics are input into the first-stage species classifier, and coarse-grained classification is performed according to the preset large categories. The first-stage classifier obtains preliminary classification results by comprehensively analyzing the seed morphological characteristics and divides the seed samples into several large categories. The purpose of this stage is to quickly narrow the classification scope and provide a basis for subsequent fine-grained classification.

[0134] Based on the classification results obtained in the preliminary classification stage, the seed samples are input into the species classifier of the second stage for confirmation classification. Based on the preliminary classification results, the second stage classifier further refines the species categories to obtain the final seed species classification results. Specifically, according to the preliminary classification results, a specialized classifier corresponding to the large category is selected to perform more detailed feature analysis and classification judgment on the seed samples. Through multi-stage classification decisions, the classification scope can be gradually narrowed and the accuracy and efficiency of classification can be improved. At the same time, by dynamically selecting the optimal classifier combination, the classification strategy can be flexibly adjusted according to the different seed morphological characteristics to meet the classification needs of different species.

[0135] In this embodiment, the weight coefficient of the classifier generated initially is combined with confidence, diversity and complementarity to optimize the weight distribution of the classifier and enhance the classification accuracy of the classification model for different seed species; the initial weight coefficient is adaptively adjusted by using a multi-layer perceptron, and the weight of the classifier is effectively optimized based on the performance index of the classifier to improve the accuracy and robustness of the classification decision; through a dynamic selection mechanism, the most suitable classifier combination is selected according to the seed morphological characteristics and the weight coefficient of the classifier to adapt to the classification needs of different seed species and improve the adaptability and accuracy of the classification model; by dividing the classification process into two stages, namely preliminary classification and confirmation classification, the classification scope is initially narrowed, and the classification results are further refined to improve the efficiency and accuracy of the classification; in the multi-stage classification decision process, the classification strategy is flexibly adjusted and the classification judgment is gradually refined, which can effectively deal with the classification challenges of different species and improve the overall performance of the classification model.

[0136] In an optional embodiment,

[0137] In the preparation stage, choose a high-density foam sponge with a porosity of about 60%-70%. The sponge has moderate hardness and is easy to cut and punch, but can maintain a certain supporting force. The sponge material should be acid and alkali resistant, non-toxic and harmless, and contain no harmful residues. According to the size of the planting frame, cut out sponge blocks of corresponding sizes. The thickness of the sponge blocks should be 5-10cm, and the length and width depend on the space of the frame. When cutting, pay attention to the size of each sponge to facilitate subsequent rolling up. According to the growth habits of leafy vegetables, reasonably set the row spacing and plant spacing (such as 20cm×20cm), use a marker to draw the grid lines of the planting points on the surface of the sponge to ensure neat arrangement. For different types of leafy vegetables, the planting density can be adjusted accordingly. In each At the marked point, use a hole puncher to punch a sowing hole of uniform depth. The hole diameter should be slightly larger than the seed (such as 0.5-1cm in diameter) to facilitate sowing. The hole should be punched vertically and should not penetrate the sponge to prevent the seed from falling into the bottom of the hole; select high-quality seeds with high germination rate and strong growth potential, put 1-2 seeds in each sowing hole, cover with a layer of sponge crumbs, and lightly compact after covering to make the seed and sponge in close contact; select non-woven fabric materials with good air permeability and biodegradability, lay a layer of non-woven fabric on the sponge block, and fix the edges with clips. The coverage should be uniform and should not affect seed germination; along the long side of the sponge block, roll it into a cylindrical shape. The rolling process should be uniform, not too tight or too loose, and tie it with a rope and tie it with a knot for easy transportation;

[0138] During the transportation stage, prepare hard plastic boxes lined with heat-insulating and shock-proof materials, and put each roll of sponge into the box separately to avoid squeezing each other. Fill the box with an appropriate amount of perlite for shock absorption and fixation. The transportation compartment should maintain a constant temperature and humidity (temperature 18-25℃, humidity 50%-60%), avoid direct sunlight or rain and snow, prevent seeds from germinating or rotting prematurely, and minimize transportation bumps to prevent the sponge blocks from loosening and deforming. Plan the transportation route in advance, choose the fastest mode of transportation, and shorten the transportation time as much as possible, generally not more than 2-3 days. If the transportation time is too long, it may affect seed vitality and reduce the germination rate.

[0139] During the planting stage on the boat, waterproof cloth is laid on the planting rack, and a water collection tank is set around it. The rack surface should be flat to facilitate the unfolding and fixing of the sponge blocks. LED fill lights are installed above the rack to adjust the light intensity and duration; the sponge rolls transported to the ship are unfolded and laid flat on the planting rack. Pay attention to laying it flat without wrinkles or depressions. Adjacent sponge blocks should be tightly spliced ​​to avoid nutrient solution leakage; a water pump and water supply pipeline are installed on one side of the rack, connected to the sponge, and a nozzle is connected to the end of the pipeline to ensure that water is evenly sprayed on the surface of the sponge. The water pump is turned on regularly to ensure that the sponge is kept moist for a long time; the intensity of the light is set according to the light requirements of the leafy vegetables. The general light cycle is 12-16 hours / day, the light intensity is 3000-5000lux, and the height of the lamp is adjustable to avoid burning the seedlings or drying the leaves. According to the growth stage of leafy vegetables, prepare nutrient solutions of different concentrations. The nutrient solution should contain various macroelements and trace elements required for the growth of leafy vegetables. The nutrient solution can be sprayed on the sponge regularly through the pipeline, each time for 15-30 minutes. Install air conditioning and ventilation systems in the planting cabin to maintain appropriate temperature and humidity. The temperature is controlled at 18-25℃, and the humidity is maintained at 60%-70%. The ventilation system should promptly discharge the CO2 produced by plant respiration and replenish fresh air.

[0140] In plant growth management, after the seeds germinate, clean up the fallen sponge crumbs and seed coats in time to avoid affecting the growth of seedlings, observe the emergence of seedlings, replant in places where seedlings are missing, thin out seedlings appropriately, remove overcrowded or poorly growing seedlings, and adjust the planting density; check the leaves regularly to find disease spots or insect eggs in time, isolate or remove plants infected with pests and diseases to prevent the spread of pests and diseases, spray an appropriate amount of biological pesticides to ensure plant health; judge the water requirement of the plant by observing the moisture level of the sponge surface, generally keep the sponge in a slightly moist state, not too dry or waterlogged, and adjust the density appropriately. Adjust the frequency and amount of irrigation to meet the needs of plant growth; regularly test the pH and EC values ​​of the nutrient solution to determine whether the nutrients are balanced. According to the growth rate of the plant, increase the amount and frequency of nutrient solution application as appropriate. Pay attention to the ratio of nitrogen, phosphorus, potassium and other macroelements to avoid too much or too little; promptly remove yellowing and withered old leaves to reduce the nutrient consumption of the plant. Appropriately prune overly lush leaves to promote the differentiation of plant growth points. Reduce irrigation a few days before harvest to reduce the moisture content of the leaves and extend the shelf life. Consider harvesting and replanting when the leaves grow to the predetermined specifications (such as 10-15cm). Harvest, the best time for harvesting is in the morning, when the water content of the plant is higher and the leaves are more tender. During the harvesting process, care should be taken to handle with care to reduce mechanical damage to the leaves; use the method of cutting even with the seedling surface, retain 3-5cm of the stem, cut neatly and levelly, and do not damage the growth point of the plant. Trim the stubble in time after cutting to reduce the breeding of pathogens; replenish water in time after cutting to ensure that the sponge is restored to a moist state, replenish nutrient solution in time to provide nutrients for the plant's regrowth, maintain appropriate light and temperature and humidity conditions, and wait for new leaves to sprout; 5-7 days after the first harvest, the new leaves will grow to about 10cm, and the second harvest can be carried out at this time, and the harvesting method is the same as above, and then it can be harvested 3-4 times every 7-10 days; when a crop of leafy vegetables is harvested 3-4 times in a row, the sponge matrix will gradually age. If the aging is serious and affects the growth of the plant, the sponge needs to be replaced, the planting rack needs to be cleaned and disinfected, a new sponge needs to be laid, and sowing needs to be started again to enter the next planting cycle;

[0141] The harvested vegetables are promptly packed and refrigerated in a warehouse with a temperature of 0-5°C and a humidity of 90%-95% to extend the storage time. According to the needs of the crew, some vegetables are taken out of the cold storage every day, washed and served for consumption.

[0142] Based on this implementation method, the particularity of ship navigation is comprehensively considered, and the innovative sponge matrix cultivation method is used to solve the crew's demand for fresh vegetables. By optimizing the sowing, transportation, planting and other links, plant growth is guaranteed to the greatest extent, space costs are saved, and the planting process is simplified. Through refined management, not only can a continuous supply of fresh leafy vegetables be achieved, but also the harvesting efficiency is high and the product quality is guaranteed, which can meet the crew's healthy diet needs for long-term sea voyages.

[0143] Figure 2 FIG. 1 is a schematic diagram of the structure of a seed felt species classification and analysis system based on a neural network model according to an embodiment of the present invention. Figure 2 As shown, the system comprises:

[0144] The first unit is used to obtain high-definition digital images of seed felt samples, pre-process the images using an adaptive threshold segmentation algorithm, extract the single seed area in the seed felt, obtain the binary mask image of the seed through contour extraction and morphological filtering, and construct a seed image dataset;

[0145] The second unit is used to introduce a pyramid pooling structure based on a pre-trained deep convolutional neural network, construct a multi-scale pyramid pooling convolutional neural network, and based on the seed image data set, restore the high-dimensional feature map on a spatial scale through progressive feature map upsampling and cross-layer feature fusion, integrate features at different abstract levels, and extract seed morphological features; input the seed morphological features into a gated recurrent unit long short-term memory network, dynamically adjust the state of the memory unit through a gating mechanism, determine the dependency of the seed morphological features in the time dimension, and establish a mapping relationship between the seed morphological feature sequence and the species category;

[0146] The third unit is used to integrate the multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network, and construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. The weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt.

[0147] According to a third aspect of the embodiments of the present invention,

[0148] An electronic device is provided, comprising:

[0149] processor;

[0150] a memory for storing processor-executable instructions;

[0151] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0152] A fourth aspect of the embodiments of the present invention is:

[0153] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0154] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A seed felt species classification analysis method based on a neural network model, characterized in that: include: Obtain high-definition digital images of seed felt samples, use adaptive threshold segmentation algorithm to preprocess the images, extract single seed regions in the seed felt, obtain binary mask images of seeds through contour extraction and morphological filtering, and construct a seed image dataset; Based on the pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image dataset, through progressive feature map upsampling and cross-layer feature fusion, the high-dimensional feature map is restored on the spatial scale, features at different abstract levels are integrated, and seed morphological features are extracted; Inputting the seed morphological features into the gated recurrent unit long short-term memory network, dynamically adjusting the state of the memory unit through the gating mechanism, determining the dependency of the seed morphological features in the time dimension, and establishing a mapping relationship between the seed morphological feature sequence and the species category; The multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated to construct multiple independent species classifiers based on the mapping relationship between the seed morphological feature sequence and the species category. The weight coefficient of each species classifier is dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt. Obtain high-definition digital images of seed felt samples, use adaptive threshold segmentation algorithm to preprocess the images, extract single seed areas in the seed felt, obtain binary mask images of seeds through contour extraction and morphological filtering, and construct seed image datasets based on the appearance morphological characteristics of seeds, including: Acquire a high-definition digital image of a seed felt sample, and preprocess the high-definition digital image, wherein the preprocessing includes local contrast enhancement and adaptive threshold segmentation, wherein the local contrast enhancement is based on an adaptive histogram equalization algorithm, the high-definition digital image is divided into a plurality of sub-regions, histogram equalization is performed on each sub-region, the local region contrast is calculated, the pixel value is adaptively changed, and the contrast difference between the seed and the background is adjusted, the adaptive threshold segmentation is based on the local mean and standard deviation of the high-definition digital image, the segmentation threshold is determined based on the local mean and standard deviation, the high-definition digital image is binarized, the pixel value corresponding to the seed region is set to 1, the pixel value corresponding to the background region is set to 0, and a binarized image is determined; A single seed is extracted based on the binary image, the geometric center of the seed area is used as the seed point, and the region growing method is used based on the similarity of pixel values ​​and the spatial adjacency relationship. After iteration, the adjacent pixel points are merged into the seed area to obtain a preliminary segmented single seed area, and the initial contour is determined. Based on the level set method, by minimizing the energy functional, combined with the pre-determined seed circularity constraint and seed compactness constraint, the boundary corresponding to the initial contour is adjusted to extract the single seed target area; Perform contour extraction and morphological filtering on the single seed target area, perform edge detection on the single seed target area based on the gradient Canny operator to obtain seed contour information, perform opening and closing operations on the seed contour information to determine a smooth seed boundary, determine a binary mask image corresponding to the seed, annotate the seed samples based on the binary mask image, and construct a seed image data set; Inputting the seed morphological features into the gated recurrent unit long short-term memory network, dynamically adjusting the state of the memory unit through the gating mechanism, determining the dependency of the seed morphological features in the time dimension, and establishing the mapping relationship between the seed morphological feature sequence and the species category include: Based on the seed morphological features, a multi-scale window is set according to a plurality of preset scales, and the multi-scale window and the corresponding step size are slid on the seed morphological features, and the continuous feature vectors in each sliding window constitute a seed morphological feature sequence, so as to construct a seed morphological feature sequence of multiple scales; Based on the seed morphological feature sequence at each scale, combined with a multi-head self-attention module, the seed morphological feature sequence is mapped to a query matrix, a key matrix, and a value matrix through a linear transformation, and the corresponding attention weights are calculated. The self-attention enhanced seed morphological feature sequence is determined through weighted summation; The self-attention enhanced seed morphological feature sequence at each scale is input into the corresponding gated recurrent unit long short-term memory network, and the hidden state is dynamically adjusted by updating the gate, resetting the gate and the memory unit to capture the corresponding long-distance dependencies in the time dimension at different scales; On the hidden state sequence of the gated recurrent unit long short-term memory network at each scale, combined with the pre-built temporal attention module, by aggregating hidden states from different time steps, a temporal attention encoding representation at the corresponding scale is obtained; The temporal attention coding representation at each scale is mapped to a shared feature space through a fully connected layer, and the feature dimensions are aligned to obtain an aligned coding representation. The importance weights of representations at different scales are learned through a pre-built scale attention module, and the final multi-scale seed morphology feature sequence coding is obtained through weighted fusion; The final multi-scale seed morphological feature sequence encoding is input into a pre-built classifier, and the probability distribution of species categories is calculated through a fully connected layer and a softmax function. The gated recurrent unit long short-term memory network is trained end-to-end in combination with a cross-entropy loss function and a back-propagation algorithm to establish a mapping relationship between the seed morphological feature sequence and the species category.

2. The method according to claim 1, characterized in that Based on the pre-trained deep convolutional neural network, a pyramid pooling structure is introduced to construct a multi-scale pyramid pooling convolutional neural network. Based on the seed image dataset, through progressive feature map upsampling and cross-layer feature fusion, the high-dimensional feature map is restored on the spatial scale, and features at different abstract levels are integrated to extract seed morphological features including: ResNet-50 is used as the base network, the fully connected layer in the base network is removed, and a global average pooling layer and a 256-dimensional fully connected layer are added after the last convolution block to generate a fine-tuned network; The attention learning module is introduced, which takes the original feature map output by the last convolutional block as input and generates a four-dimensional attention weight vector through global average pooling and two fully connected layers; Based on the original feature map, four adaptive-scale average pooling layers are applied to pool the original feature map into spatial resolutions of 1×1, 2×2, 3×3, and 6×6, and four scale pooling feature maps are determined; Based on the four-dimensional attention weight vector, four scale pooling feature maps are weightedly fused to obtain an adaptive multi-scale feature map; Based on the adaptive multi-scale feature map, the pooled feature maps corresponding to the 1×1, 2×2 and 3×3 scales are restored to the same size as the original feature map through upsampling operations, and aligned in the spatial dimension using bilinear interpolation to obtain an aligned feature map; Through the lightweight attention module, we learn to align the importance of different regions in the feature map and generate a spatial attention weight map. Multiplying the spatial attention weight map with the corresponding aligned feature map to obtain an attention-enhanced feature representation, and fusing the attention-enhanced feature representations corresponding to different scales through element-level weighting to obtain a multi-scale fused feature map; Based on the multi-scale fusion feature map, the number of channels is reduced to 256 dimensions through a 1×1 convolution layer, and the spatial dimension features corresponding to the multi-scale fusion feature map are compressed into a 256-dimensional seed morphological feature vector through global average pooling to extract the seed morphological features.

3. The method according to claim 1, characterized in that: After determining the self-attention enhanced seed morphological feature sequence, the final multi-scale seed morphological feature sequence encoding is obtained, which also includes: Based on the self-attention enhanced seed morphological feature sequence, combined with the gated memory network, the long-term dependency of the self-attention enhanced seed morphological feature sequence is dynamically stored and updated through the memory matrix, and the corresponding memory information reading, writing and forgetting are controlled through the gating mechanism to obtain the gated memory result; Based on the gated memory result, combined with the residual self-attention module, the corresponding internal dependency relationship is modeled through the multi-head self-attention mechanism, the internal attention output result is determined, and the internal attention output result is residually connected with the seed morphological feature sequence at the corresponding scale to obtain the residual self-attention seed morphological feature sequence; Based on the residual self-attention seed morphological feature sequence, encoding is performed through a gated recurrent unit to capture the corresponding evolution law in the time dimension, and obtain the seed morphological feature sequence encoding at the corresponding scale; The seed morphological feature sequences at different scales are encoded and fused through a multi-scale interactive attention module, and the correlation and importance between different scales are adaptively learned through interactive calculations of a query matrix, a key matrix, and a value matrix to obtain a multi-scale interactive attention encoding; Based on the multi-scale interactive attention coding and combined with an adaptive fusion gating unit, the contribution of seed morphological feature sequence coding of different scales is adaptively adjusted through a gating mechanism, and weighted fused with the multi-scale interactive attention coding to obtain the final multi-scale seed morphological feature sequence coding.

4. The method according to claim 1, characterized in that The multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network are integrated to construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. Based on the ensemble learning strategy of adaptive weights, the weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function to construct a classification decision model including: Based on the species classifier, the corresponding confidence, diversity and complementarity are determined to generate weight coefficients. Based on the multi-layer perceptron, the weight coefficients are iteratively adjusted through nonlinear transformation and parameter learning to determine the adaptive weight generation function. Based on a predetermined dynamic selection mechanism, multiple optimal species classifiers are selected from multiple species classifiers through seed morphological characteristics combined with an adaptive weight generation function, and a classification decision model is constructed by adjusting the combination and weight distribution of the optimal species classifiers. The classification decision model decomposes the seed species classification process into multiple stages according to a preset number of stages, inputs the seed morphological characteristics into the first-stage species classifier, obtains preliminary classification results according to preset major categories, and inputs the preliminary classification results into the second-stage species classifier for confirmation and classification to obtain the seed felt species classification results.

5. A seed felt species classification analysis system based on a neural network model, used to implement the method described in any one of claims 1 to 4, characterized in that: include: The first unit is used to obtain high-definition digital images of seed felt samples, pre-process the images using an adaptive threshold segmentation algorithm, extract the single seed area in the seed felt, obtain the binary mask image of the seed through contour extraction and morphological filtering, and construct a seed image dataset; The second unit is used to introduce a pyramid pooling structure based on a pre-trained deep convolutional neural network, construct a multi-scale pyramid pooling convolutional neural network, and based on the seed image dataset, restore the high-dimensional feature map in the spatial scale through progressive feature map upsampling and cross-layer feature fusion, integrate features at different abstraction levels, and extract seed morphological features; Inputting the seed morphological features into the gated recurrent unit long short-term memory network, dynamically adjusting the state of the memory unit through the gating mechanism, determining the dependency of the seed morphological features in the time dimension, and establishing a mapping relationship between the seed morphological feature sequence and the species category; The third unit is used to integrate the multi-scale pyramid pooling convolutional neural network and the gated recurrent unit long short-term memory network, and construct multiple independent species classifiers based on the mapping relationship between seed morphological feature sequences and species categories. The weight coefficients of each species classifier are dynamically adjusted through a nonlinear mapping function based on an integrated learning strategy based on adaptive weights to construct a classification decision model. The seed felt to be classified is input into the classification decision model to determine the species of the seed felt.

6. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Breast neoplasms ultrasonic image segmentation method based on improved level set algorithm

    CN104599270A

  • End-to-end classification method for single-voyage InSAR system based on multistage deep learning network

    CN112083422A

  • Green seedling type identification method and system

    CN118861762A

  • Deep learning-based aneurysm detection and rupture risk assessment method and system

    CN118864407A

  • Temperature control method and device for UV LED module

    CN118890741A