X-ray single projection imaging seed intelligent classification method and system and medium

By combining phase-contrast X-ray single-projection imaging with deep learning, and utilizing the Inception-ResNet-V2 network and image preprocessing, we achieved efficient, lossless, and accurate seed classification, solving the problems of low efficiency and high destructiveness in traditional methods, and adapting to dynamic optimization of new species.

CN121121231APending Publication Date: 2025-12-12SHANGHAI ADVANCED RES INST CHINESE ACADEMY OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511218633.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Traditional seed classification methods are inefficient, destructive, and difficult to accurately distinguish closely related species. Furthermore, CT imaging-based methods are time-consuming and cannot achieve efficient and non-destructive classification.

Method used

A method based on phase-contrast X-ray single projection imaging combined with deep learning was adopted. The Inception-ResNet-V2 network was used to classify seeds. Seed identification was performed by acquiring a single projection image. The deep learning model was optimized to adapt to the addition of new species by combining image preprocessing and multi-angle projection probability fusion algorithm.

Benefits of technology

It achieves efficient, non-destructive, and accurate seed classification, solving the problems of low efficiency and high destructiveness in traditional methods. It can accurately identify seed species and origins and adapt to dynamic optimization of newly added species.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121231A_ABST
    Figure CN121121231A_ABST
Patent Text Reader

Abstract

The invention provides an X-ray single projection imaging seed intelligent classification method and system and a medium, and the method comprises the steps: obtaining projection images of different seed samples at different angles through an X-ray phase contrast imaging system, and taking the projection images as an image data set; pre-processing the projection image to obtain a pre-processed image data set; training a deep learning model by using the preprocessed image data set; the deep learning model adopts an Inception-ResNet-V2 network architecture, and the depth learning model adopts a depth learning model; and obtaining a sample to be tested, shooting a single projection image at any angle, preprocessing the single projection image, and inputting the preprocessed image into the trained deep learning model for classifying the seed sample. According to the method, through collaborative innovation of non-destructive and efficient phase contrast X-ray single projection imaging and deep learning, the internal texture of the seeds is obtained, and accurate classification of the seeds can be losslessly and efficiently achieved only through a single X-ray projection image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of X-ray imaging, agricultural technology, image processing, and artificial intelligence, specifically to an intelligent seed classification method, system, and medium based on phase-contrast X-ray single-projection imaging, which is used for efficient and non-destructive identification of seed species and origin. Background Technology

[0002] Seed classification is of great significance in agricultural production, biodiversity conservation, food safety, and ecological research. Traditional seed classification methods rely on morphological and anatomical approaches, classifying and identifying species by observing characteristics such as seed shape, size, color, texture, surface pattern, and internal structure. However, these techniques can damage seeds and, due to significant influences from environmental factors and individual differences, sometimes fail to provide accurate judgments.

[0003] With continuous technological advancements, seed classification techniques have seen significant improvements. For example, molecular biology-based techniques can accurately identify seeds by extracting DNA sequences or specific macromolecular structures; however, these novel techniques can damage samples and typically involve longer classification cycles. Furthermore, non-destructive methods utilizing 3D phenotyping platforms and optical microscopy have been widely adopted in seed classification, but these methods often rely on expert judgment and are inefficient. Additionally, manually extracted image features may be incomplete or redundant.

[0004] Deep learning has demonstrated superior performance in classification tasks, leading to its gradual replacement of traditional image classification techniques in some fields. Currently, significant research achievements have been made in automatic seed classification based on computer vision and image processing. For example, the VGG16 model used in the reference [Y. Hamid, S. Wani, Aboomro, AAAAlwan, and Y. Gulzar, "Smartseed classification system based on MobileNetV2 architecture," in 2022 2nd international conference on computing and information technology (ICCIT), 2022: IEEE, pp. 217-222.] classified 14 types of visible light seed images with an accuracy of 99%; the reference [Y. Gulzar, Y. Hamid, Aboomro, AAAAlwan, and L. Journaux, "A convolutionneural network-based seed classification system," Symmetry, vol. 12, no. 12, p. 2018, 2020] used the lightweight network MobileNetV2 to classify 14 different types of visible light seed images, achieving an accuracy of 95%. However, since these methods use visible light images as datasets and rely solely on surface features, accurately classifying seeds with similar appearances remains challenging, and the captured visible light images are easily distorted by environmental factors such as lighting.

[0005] Traditional methods often rely on external morphology or internal composition, while internal texture analysis may have been overlooked. The main reason is that traditional internal texture analysis methods require ultrathin sections, which are difficult to slice, especially for most seed samples which are hard. For species whose external morphology is difficult to discern, internal composition methods are often used. These methods require the addition of chemical reagents to extract the effective components of internal features, which not only damages the sample but also pollutes the environment due to the use of chemical reagents.

[0006] X-rays possess strong penetrating power, allowing for the observation of the original sample's internal structure without destruction. However, X-ray imaging utilizes transmitted light information to obtain information about the sample's internal structure. This transmitted light information carries the superposition of information from all layers of the sample. Conventionally, this single-projection X-ray phase-contrast image, with its superimposed information, suffers from low signal-to-noise ratio and strong background interference, making it difficult to classify and identify a sample. Therefore, traditionally, multi-angle projection or CT methods are used to classify and identify samples through three-dimensional reconstruction of the internal structure, resulting in low efficiency. X-ray computed tomography (CT) imaging can perform non-destructive, high-resolution imaging and has been used to obtain the internal structure of various agricultural products for quality assessment. However, due to the need to collect a large number of projections and then reconstruct their three-dimensional microstructure, CT-based classification methods are difficult to implement efficiently. Specifically, CT-based classification methods require acquiring thousands of projections, then processing and reconstructing these projections to obtain numerous slice images, which are then superimposed to obtain a three-dimensional structural reconstruction of the seed for identification. This process is quite complex and takes a long time.

[0007] This invention utilizes single-projection imaging combined with deep learning. After the database is built, species identification or place of origin identification can be achieved using only a single projection image. Summary of the Invention

[0008] The purpose of this invention is to propose an intelligent seed classification method, system, and medium based on X-ray single-projection imaging, which achieves accurate seed classification based on a single X-ray projection of the seed.

[0009] To achieve the above objectives, this invention provides a seed intelligent classification method based on phase-contrast X-ray single-projection imaging, comprising:

[0010] S1: Using different seeds as samples, X-ray phase contrast imaging system is used to obtain single-projection images of the samples at different angles, which are used as image datasets.

[0011] S2: Preprocess the single projection image to obtain a preprocessed image dataset;

[0012] S3: Train the deep learning model using the preprocessed image dataset; the deep learning model adopts the Inception-ResNet-V2 network architecture;

[0013] S4: Acquire the sample to be tested and take a single-projection image from any angle, preprocess it, and input the preprocessed image into a trained deep learning model for sample classification.

[0014] The X-ray phase contrast imaging system includes a microfocus X-ray source, a sample translation stage, and a surface detector arranged in sequence. The sample translation stage is used to mount the sample, which is a seed.

[0015] The X-ray source, sample translation stage, and surface detector are arranged coaxially, and the sample translation stage and surface detector can move along the optical axis.

[0016] In step S1, the acquired single-projection images are used as an image dataset, of which 80% are allocated as a training dataset and 20% as a validation dataset. In addition, seed samples from non-training and validation experiments are collected as a test dataset. In step S3, the preprocessed training dataset and validation dataset are used to train and validate the deep learning model. The trained and validated deep learning model is used to classify the samples.

[0017] Step S1 further includes: performing data augmentation on the image dataset by using at least one of random cropping, brightness enhancement, contrast adjustment, and flipping.

[0018] The preprocessing includes flat and dark field correction, background segmentation, and size normalization.

[0019] The background segmentation employs either a traditional thresholding method or a deep learning-based intelligent image segmentation method. The deep learning-based intelligent image segmentation method specifically includes: selecting the U-net model as the deep learning segmentation network; inputting the single-projection image to be segmented into the deep learning segmentation network, causing the segmentation network to output a binarized segmented image corresponding to the input single-projection image; in the binarized segmented image, the region corresponding to the seed has a value of 1, and the region outside the seed has a value of 0; finally, by multiplying the original single-projection image with the binarized segmented image, the single-projection image after background segmentation is obtained; the loss function of the deep learning model is set to cross-entropy loss.

[0020] In step S4, the classification results obtained from the sample classification include seed type, origin information, or seeds not yet in storage; the seed classification method also includes step S5: generating seed type identifiers based on the classification results and issuing warnings for seeds not yet in storage.

[0021] The seed intelligent classification method based on phase-contrast X-ray single-projection imaging further includes step S6: when adding a new seed category, a transfer learning strategy is used to dynamically optimize the deep learning model; step S6 specifically includes:

[0022] S61: Remove the AFDS layer from the original deep learning model and use the weights of the feature extraction network other than the AFDS layer as initialization parameters.

[0023] S62: Add output nodes corresponding to the newly added seed categories to the original AFDS layer, and add the modified AFDS layer to the original feature extraction network to obtain a deep learning network. Then, fine-tune the deep learning network based on the newly added image dataset.

[0024] On the other hand, the present invention provides a seed intelligent classification system based on phase-contrast X-ray single-projection imaging, comprising:

[0025] An X-ray phase-contrast single-projection imaging system is configured to use a seed as a sample to acquire a single-projection image of the sample.

[0026] The image preprocessing module is used to preprocess single-projection images;

[0027] The deep learning classification module is equipped with a trained deep learning model, which uses the Inception-ResNet-V2 network and is used to classify samples.

[0028] The result output module generates seed type identifiers based on the classification results obtained from sample classification, and issues warnings for seeds not yet included in the database.

[0029] On the other hand, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the seed intelligent classification method based on phase-contrast X-ray single-projection imaging described above.

[0030] This invention discloses a seed intelligent classification method based on phase-contrast X-ray single-projection imaging. Through the synergistic innovation of non-destructive and efficient phase-contrast X-ray single-projection imaging and deep learning, the internal texture of seeds is obtained. Combined with deep learning, a highly efficient, non-destructive, accurate, and scalable seed classification method is achieved. This efficient and non-destructive classification method solves the bottleneck problems of low efficiency, high destructiveness, and difficulty in distinguishing closely related species in traditional technologies. It only requires a single X-ray projection image to achieve accurate seed classification in a non-destructive and efficient manner. Attached Figure Description

[0031] Figure 1 This is a flowchart of a seed intelligent classification method based on phase contrast X-ray single projection imaging according to the present invention.

[0032] Figure 2 This is a schematic diagram illustrating the detection principle of a seed intelligent classification method based on phase-contrast X-ray single-projection imaging according to the present invention. Detailed Implementation

[0033] The present invention will be further described below with reference to specific embodiments. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0034] This invention discloses an intelligent seed classification method based on phase-contrast X-ray single-projection imaging. It acquires the internal texture of seeds using an X-ray phase-contrast imaging system and combines this with deep learning. Accurate seed classification can be achieved with only a single X-ray projection image, thus realizing seed classification non-destructively and efficiently. Because seeds are mainly composed of low-Z materials, X-ray phase-contrast imaging is beneficial for enhancing the contrast of the seed's internal texture. When X-rays pass through an object, the phase term is typically 2 to 3 orders of magnitude larger than the absorption term, indicating that the sensitivity of phase-contrast X-ray imaging is much higher than that of traditional absorption imaging. Utilizing X-ray phase changes to enhance the contrast of weakly absorbing materials (such as the internal structure of seeds) is superior to traditional absorption imaging.

[0035] like Figure 1 As shown, the intelligent seed classification method based on phase-contrast X-ray single-projection imaging of the present invention includes the following steps:

[0036] Step S1: Using different seeds as samples, use an X-ray phase contrast imaging system to acquire single-projection images of the samples at different angles, which will be used as an image dataset.

[0037] After acquiring single-projection images of seeds from different angles, these images reveal the seed's internal texture features. Therefore, by combining this with deep learning, accurate seed classification can be achieved using only a single X-ray projection image, and the method can be implemented efficiently and without loss of quality. In other words, after building a database, acquiring a sample to be tested and capturing a single-projection image from any angle allows identification of the seed type or origin.

[0038] like Figure 2 As shown, the intelligent seed classification method based on phase-contrast X-ray single-projection imaging of the present invention uses an X-ray phase-contrast imaging system to acquire single-projection images. It supports single-projection imaging and has a data acquisition time ≤100ms. The X-ray phase-contrast imaging system includes a microfocus X-ray source 10, a sample translation stage 20, and a surface detector 30 arranged sequentially. The sample translation stage 20 is used to mount a sample 21, which is a seed. The X-ray source 10, the sample translation stage 20, and the surface detector 30 are coaxially arranged, and the sample translation stage 20 and the surface detector 30 can move along the optical axis to adjust the magnification of the imaging system.

[0039] Among them, the microfocus X-ray source 10 is preferably a microfocus transmission tungsten target X-ray tube (X-ray WorXGmbH, XWT-225-THE Plus) with a focal length of 2μm to ensure the spatial coherence of phase-contrast imaging.

[0040] The surface detector 30 employs an X-ray flat panel detector, comprising a CsI scintillator (DALSA6K) and a complementary metal-oxide-semiconductor (CMOS) detector (the scintillator is in front of the CMOS and fiber optic panels) to achieve a large field of view and high-resolution imaging. The surface detector 30 has an scalable field of view of up to 114 mm × 146 mm, i.e., a pixel array of 2304 pixels × 2940 pixels, with a single pixel size of 49.5 μm.

[0041] The microfocus X-ray source 10 is fixed, and the sample translation stage 20 is used to perform four-dimensional motion in X, Y, Z (three-dimensional translation) and W (one-dimensional rotation).

[0042] To meet the training and testing requirements of deep learning neural networks, the sample selected seeds from several experimental types, such as lentils, broad beans, barley, oats, rice, hemp seeds, sorghum seeds, radish seeds, mung beans, peas, wheat, chickpeas, etc., with dozens of seeds of each type selected.

[0043] The acquired single-projection images were used as the image dataset, with 80% allocated to the training dataset and 20% to the validation dataset. Additionally, seed samples from non-training and non-validation experiments were collected as the test dataset. To ensure the probability distribution of the collected image dataset was as reasonable as possible, the samples were randomly fixed on the sample translation stage 20 of the X-ray phase-contrast imaging system.

[0044] A single projection image is the result of superimposing multiple layers of information along the seed's optical path. The information contained in the projection at different angles may differ. Therefore, it is necessary to collect projection images of the seed at different angles to refine the different projection information of the seed at different angles. In this embodiment, for the seeds in the training and validation datasets, one image is taken for every 0.3° rotation, resulting in 360 / 0.3 = 1200 projection images to ensure that as many angle positions as possible are collected; for the test dataset, one image is taken for every 3° rotation, resulting in 360 / 3 = 120 projection images.

[0045] Step S1 may further include: using at least one of various processing methods such as random cropping, brightness enhancement, contrast adjustment, and flipping to perform data augmentation on the image dataset in order to achieve cross-modal data adaptation.

[0046] Step S2: Preprocess the single projection image to obtain a preprocessed image dataset;

[0047] In order to better focus the feature texture information of the sample projection image and eliminate other interfering factors, image preprocessing is necessary. The preprocessing includes flat field and dark field correction, background segmentation, and size normalization.

[0048] Step S1 further includes acquiring a dark-field image without a sample and without X-rays and a flat-field image without a sample but with X-rays to perform flat-field and dark-field correction of the projected image.

[0049] Flat and dark field corrections are designed to ensure the generated image is optimally prepared for subsequent analysis. They are applied to minimize the impact of variations in background illumination and detector characteristics on the projected image. The formula for flat field correction is:

[0050]

[0051] Among them, I c (x,y) represents the corrected projected image, and I(x,y) represents the original projected image. f (x,y) is a flat-field image, I d (x,y) is the dark field image.

[0052] Background segmentation: To eliminate the potential impact of sample magnification on classification results during imaging, it is necessary to separate the sample from the blank background image and normalize the segmented sample image to 512×512 pixels. Image cropping and segmentation to focus only on the seed helps reduce computational complexity and increases attention to the classification of relevant features.

[0053] The background segmentation employs either a traditional threshold segmentation method or a deep learning-based intelligent image segmentation method.

[0054] Traditional thresholding methods have limitations in completely separating samples from the background. This embodiment employs a deep learning-based intelligent image segmentation method, specifically including: selecting the U-net model as the deep learning segmentation network, which is widely used in medical image segmentation; inputting the single-projection image to be segmented into the deep learning segmentation network, so that the segmentation network outputs a binarized segmentation image corresponding to the input single-projection image; in the binarized segmentation image, the region corresponding to the seed has a value of 1, and the region outside the seed has a value of 0; finally, by multiplying the original single-projection image with the binarized segmentation image to eliminate background interference, a single-projection image after background segmentation is obtained.

[0055] Size normalization includes: Size normalization is used to ensure that all processed images have a consistent size, which is crucial for effectively training neural networks because it requires the input data to have a uniform shape and size.

[0056] Step S3: Train the deep learning model using the preprocessed image dataset;

[0057] The deep learning model is trained and validated using preprocessed training and validation datasets. The trained and validated model is then used for sample classification. After training, the model is tested using a test dataset to evaluate its generalization ability.

[0058] The deep learning model adopts the Inception-ResNet-V2 network architecture. In the field of deep learning-based image classification, commonly used basic network architectures include ResNet [He, K.; Zhang, X.; Ren, S.; Sun, J. In Deep residual learning for image recognition, Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp 770-778.], Inception [Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. In Rethinking the inception architecture for computer vision, Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp 2818-2826], and an improved network that combines the functions of Inception and ResNet, called Inception-ResNet [Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A. In Inception-v4, inception-resnet and the impact of residual connections on [Learning, Proceedings of the AAAI conference on artificial intelligence, 2017.]. ResNet addresses the performance degradation issue with increasing network depth by introducing a residual network, effectively preventing model performance decline and thus improving accuracy. The Inception network improves computational resource utilization while maintaining high accuracy by expanding network width and stacking Inception modules. Inception-ResNet-V2 combines the advantages of both by deepening and broadening the network structure, increasing complexity, and improving accuracy. Therefore, this invention selects the Inception-ResNet-V2 network for intelligent classification of seed samples.

[0059] The Inception-Resnet-V2 network is a commonly used basic network structure in the field of deep learning image classification. The specific structure has been disclosed in the paper [Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A. In Inception-v4, inception-resnet and the impact of residual connections on learning, Proceedings of the AAAI conference on artificial intelligence, 2017.].

[0060] The existing Inception-ResNet-V2 network architecture includes a feature extraction network and an AFDS layer, which generates class probability distributions through a Softmax layer.

[0061] The AFDS layer in a deep learning model typically includes average pooling layers, fully connected layers, dropout layers, and softmax layers. The average pooling layer compresses the extracted feature map information into a one-dimensional vector. The dropout layer, during the training phase, randomly deactivates a portion of neurons (setting their weights and biases to zero) to prevent overfitting and enhance network robustness. The softmax layer maps the final one-dimensional output vector to values ​​between 0 and 1, producing a result similar to a probability distribution, where the output value S of the i-th neuron... i The mapping according to formula (2) is as follows:

[0062]

[0063] Among them, e i The value before the mapping of the i-th neuron is given, and the maximum value of i is the number of classifications in the network.

[0064] Since the network is designed to solve the classification problem of multiple types of seed samples, the loss function of the deep learning model is set as cross-entropy loss. The network loss function is shown in equation (3):

[0065]

[0066] Where Y represents the true distribution of the dataset, y represents the predicted distribution, j represents the index of the seed sample type, and M represents the number of seed sample types in the library. The loss function reaches its minimum value when the y distribution is close to the Y distribution, indicating that network training is complete.

[0067] The model's predictive ability was then validated by selecting samples from different species from the preprocessed validation dataset to test the network model's performance. For example, the model validation results showed that the trained network model achieved a prediction accuracy of 1 for most categories. For seeds with very similar features, such as wheat and oat seeds, the accuracy was slightly lower (0.967). Regarding recall, except for sorghum, wheat, and oats, whose recall ranged from 0.975 to 0.985, the recall for most categories reached a maximum of 1.

[0068] Accuracy = True Positives / (True Positives + False Positives); Recall = True Positives / (True Positives + False Negatives). True Positive: The image input to the prediction network is a seed, and the model predicts it as that seed. False Positive: The image input to the prediction network is not a seed, but the model incorrectly classifies it as a seed. False Negative: The image input to the prediction network is a seed, but the model incorrectly classifies it as another type of seed.

[0069] It can be concluded that the network model performs well in terms of precision and recall when predicting and identifying seed samples of different species, and can be applied in practice.

[0070] Step S4: Obtain a single-projection image of the sample to be tested from any angle, preprocess it, and input the preprocessed image into a trained deep learning model for sample classification.

[0071] The classification results obtained from sample classification include seed type, origin information, or seeds not yet in storage.

[0072] Among them, the multi-angle projection probability fusion algorithm is used to quantify the fusion confidence of multiple projection angles, thereby improving the classification accuracy of seeds of the same seed type but different origin information.

[0073] The multi-angle projection probability fusion algorithm acquires different projections of the same sample from different angles, predicts the classification results (i.e. obtains the probabilities of different classifications) for each projection image, and statistically analyzes the classification results and corresponding probabilities of all projected images to obtain the fusion confidence Psim.

[0074] The formula for the fusion confidence score Psim is:

[0075]

[0076] Where j is the category index of the sample library, k is any test sample image, N is the total number of test sample images, and y[j][k] is the prediction distribution from the deep learning network.

[0077] The identification of seeds not included in the database in step S4 includes calculating their fusion confidence Psim with various sub-categories in the image dataset. If the fusion confidence Psim does not meet the threshold condition, it is determined to be an unknown category and the database expansion process is triggered.

[0078] Step S5 (optional): Generate seed type identifiers based on the classification results and issue warnings for seeds not yet included in the database.

[0079] Step S6 (optional): When adding a new seed category, use a transfer learning strategy to dynamically optimize the deep learning model.

[0080] Step S6 specifically includes:

[0081] Step S61: Remove the AFDS layer from the original deep learning model and use the weights of the feature extraction network outside the AFDS layer as initialization parameters;

[0082] Step S62: Add output nodes corresponding to the newly added seed categories to the original AFDS layer, and add the modified AFDS layer to the original feature extraction network to obtain a deep learning network. Then, fine-tune the deep learning network based on the newly added image dataset.

[0083] Data migration reduced the number of training iterations by 33%.

[0084] Therefore, the optimization of the deep learning model of the present invention includes:

[0085] 1) When adding new sample types or performing transfer learning (i.e., when a new learning model needs to be built), remove the AFDS layer (average pooling layer, fully connected layer, Dropout layer, and Softmax layer) and retain the weights of the feature extraction network.

[0086] 2) Optimize the configuration of the residual module or Inception module in the Inception-ResNet-V2 network architecture to better capture the internal microstructure of the seed.

[0087] In this embodiment, the configuration of the residual module or the Inception module refers to the existing configuration, specifically referring to [Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A. In Inception-v4, inception-resnet and the impact of residual connections on learning, Proceedings of the AAAI conference on artificial intelligence, 2017.].

[0088] 3) Employ data augmentation strategies such as random cropping, brightness enhancement, contrast adjustment, and flipping to achieve cross-modal data adaptation.

[0089] 4) The loss function is cross-entropy loss, which makes the training results more accurate.

[0090] On the other hand, the present invention provides a seed intelligent classification system based on phase-contrast X-ray single-projection imaging, comprising: an X-ray phase-contrast imaging system configured to use seeds as samples and acquire single-projection images of the samples at different angles; an image preprocessing module for performing planar correction, segmentation, and normalization on the single-projection images; a deep learning classification module equipped with a trained deep learning model, wherein the deep learning model adopts the Inception-ResNet-V2 network and is used for sample classification; and a result output module, which generates seed type identifiers based on the classification results obtained from the sample classification and provides early warnings for seeds not yet included in the database.

[0091] Furthermore, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the seed intelligent classification method based on phase-contrast X-ray single-projection imaging described above.

[0092] Example 1

[0093] The experiment selected 12 types of biological seed samples, including lentils, broad beans, barley, rice, hemp seeds, sorghum seeds, radish seeds, mung beans, peas, wheat, and chickpeas (including lentils from two different origins), to meet the training and testing requirements of the deep learning neural network. 60-100 seeds were selected for each type. 80% of the seeds were allocated to the training and validation datasets, and 5 seeds were selected from the remaining 20% ​​for the test dataset. The imaging system of this invention was used to collect phase-contrast-based X-ray single-projection images of the 12 seed samples. The experimental parameters were set as follows: tube voltage 60kV, current 100μA, exposure time 100ms, source-to-detector distance (SDD) 314mm, and source-to-object distance (SOD) adjusted according to the selected samples. To ensure the probability distribution of the collected image dataset was as reasonable as possible, the seeds were randomly fixed on the sample stage. The images obtained by X-ray projection are the result of superimposed information from multiple layers of seeds; therefore, the information contained in the projections at different angles may differ. For the seeds in the training and validation datasets, one image is taken every 0.3° rotation, resulting in 360 / 0.3 = 1200 projected images to ensure that as many angular positions as possible are collected; for the test dataset, one image is taken every 3° rotation, resulting in 360 / 3 = 120 projected images.

[0094] In addition, step S1 also acquires dark-field images without samples and without X-rays, and flat-field images without samples but with X-rays, for flat-field and dark-field correction of the projected images. Image preprocessing is necessary to better focus the features of the sample projected images and eliminate other interfering factors. This includes flat-field and dark-field correction, image cropping, image segmentation, and size normalization. This preprocessing sequence aims to ensure that the generated images are optimally prepared for subsequent analysis. Flat-field correction is applied to minimize the impact of background illumination and detector characteristic variations on the projected images. The flat-field correction algorithm given in formula (1) is used to remove the background, where I... c (x,y) represents the corrected projected image, and I(x,y) represents the original projected image. f (x,y) is a flat-field image, I d (x,y) is a dark field image.

[0095]

[0096] To eliminate the potential impact of sample magnification on classification results during imaging, it is necessary to separate the sample from the blank background image and normalize the segmented sample image to 512×512 pixels. Cropping and segmenting the image to focus only on the seed helps reduce computational complexity and increases attention to the classification of relevant features.

[0097] Finally, size normalization ensures that all processed images have a consistent size, which is crucial for effectively training the neural network, as it requires the input data to have a uniform shape and size. Traditional thresholding segmentation methods have limitations in completely separating samples from the background. This patent employs a deep learning method for intelligent image segmentation, selecting the U-net model, which is widely used in medical image segmentation. After the image to be segmented is input into the segmentation network, the network outputs a binarized segmented image corresponding to the input projected image. In the binarized segmented image, the region corresponding to the seed has a value of 1, and the region outside the seed has a value of 0. Finally, by multiplying the original projected image with the binarized segmented image, background interference is eliminated, thus obtaining the segmented seed sample image. The neural network model takes the sample image as input and outputs a vector, which corresponds to the number of sample categories. The position corresponding to the maximum value of the vector is the prediction result.

[0098] Then, based on these preprocessed training and validation datasets, training and validation are performed. The Inception-Resnet-V2 network is used to identify sample seeds. After model training, the trained deep learning model is tested using a test dataset to evaluate its generalization ability.

[0099] In the field of deep learning-based image classification, commonly used basic network architectures include ResNet [He, K.; Zhang, X.; Ren, S.; Sun, J. In Deep residual learning for image recognition, Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp 770-778.], Inception [Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. In Rethinking the inception architecture for computer vision, Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp 2818-2826], and an improved network that combines the functions of Inception and ResNet, called Inception-ResNet [Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A. In Inception-v4, inception-resnet and the impact of residual connections on [Learning, Proceedings of the AAAI conference on artificial intelligence, 2017.]. ResNet addresses the performance degradation issue with increasing network depth by introducing a residual network, effectively preventing model performance decline and thus improving accuracy. The Inception network improves computational resource utilization efficiency while maintaining high accuracy by expanding network width and stacking Inception modules. Inception-ResNet-V2 combines the advantages of both by deepening and broadening the network structure, increasing complexity, and improving accuracy. This invention selects the Inception-ResNet-V2 network for intelligent classification of seed samples.

[0100] The final layer of a network typically includes AveragePooling, Fully Connecting, Dropout, and Softmax. AveragePooling compresses the extracted feature map information into a one-dimensional vector. Dropout is used during the training phase to prevent overfitting by randomly deactivating a portion of neurons (i.e., setting their weights and biases to zero), thereby enhancing the network's robustness. Softmax maps the final output one-dimensional vector to values ​​between 0 and 1, producing a result similar to a probability distribution, where the output value Si of the i-th neuron is mapped according to formula (2).

[0101]

[0102] Among them, e i The value before the mapping of the i-th neuron is given, and the maximum value of i is the number of classifications in the network.

[0103] Typically, trained models achieve high classification rates on the training set. However, due to overfitting, they often perform poorly on the test set. To avoid overfitting and improve the generalization ability of machine learning models, this embodiment employs image enhancement techniques. During seed sample image enhancement, different types of projected images are artificially created through various processing methods, such as brightness enhancement, contrast enhancement, and flipping, or combinations thereof. Random brightness enhancement and contrast adjustment roughly simulate projected images obtained under different exposure times and energies; the random brightness step involves randomly increasing or decreasing grayscale values ​​by 100–500. The random contrast adjustment step redistributes the grayscale histogram of the image, with the redistributed minimum and maximum grayscale values ​​randomly set to 90%–110% of their original values. These enhancement techniques are randomly applied to images in the training set, effectively increasing the diversity of training images and ensuring that even initially very similar images become more diverse after enhancement. However, the images in the test set remain unchanged to accurately evaluate the model's generalization ability. A validation dataset is used to evaluate the model's convergence efficiency during training.

[0104] The training and test datasets involve all 12 seed types in total. Since the network is designed to solve the classification problem of multi-type seed samples, the network loss function is set to cross-entropy loss, as shown in Equation (3).

[0105]

[0106] Where Y represents the true distribution of the dataset, y represents the predicted distribution, j represents the index of the seed sample type, and M represents the number of seed sample types in the library. The loss function reaches its minimum value when the y distribution is close to the Y distribution, indicating that network training is complete.

[0107] The model's predictive ability was then tested. Samples from different species were selected from the preprocessed test dataset to test the network model's performance. The test dataset consisted of entirely new seed samples that had never been used during network training, used to confirm the generality and versatility of the network algorithm in seed species identification after training. The test dataset contained 12 different types of samples. Each species consisted of 5 seeds, and data was collected from 120 angles for each seed, totaling 600 images per sample type. In this embodiment, the model test results were as follows: the trained network model achieved a prediction accuracy of 1 for most categories. Due to the very similar characteristics of wheat and oat seeds, their precision values ​​were low (0.967). Regarding recall, except for sorghum, wheat, and oats, whose recall values ​​ranged from 0.975 to 0.985, most categories achieved a maximum recall of 1.

[0108] (Accuracy = True Positives / (True Positives + False Positives); Recall = True Positives / (True Positives + False Negatives); True Positive: The image input to the prediction network is a seed, and the model predicts it as a seed. False Positive: The image input to the prediction network is not a seed, but the model incorrectly classifies it as a seed. False Negative (FN): The image input to the prediction network is a seed, but the model incorrectly classifies it as another type of seed.)

[0109] Therefore, the network model performed well in terms of precision and recall when identifying seed samples of different species based on any one prediction. For lentils, both the prediction precision and recall were 0.95. This is because a small number of projected images of lentils from origin A were incorrectly classified as origin B, and vice versa. However, very few samples were classified as belonging to other samples in the library, which is consistent with the expectation of morphological classification methods. These test results indicate that the network model of this patent can also be further used to effectively distinguish samples of the same species from different origins.

[0110] This invention discloses a seed intelligent classification method based on phase-contrast X-ray single-projection imaging. Through the synergistic innovation of non-destructive and efficient phase-contrast X-ray single-projection imaging technology and an improved deep learning network model, it acquires the internal texture of seeds and, combined with deep learning, achieves an efficient, non-destructive, accurate, and scalable intelligent seed classification method. This efficient, non-destructive, and intelligent classification method solves the bottleneck problems of low efficiency, high destructiveness, and difficulty in distinguishing closely related species in traditional techniques. This method only requires a single X-ray projection image to achieve accurate seed classification non-destructively and efficiently.

[0111] This invention is the first to propose a phase-contrast X-ray single-projection imaging combined with an improved deep learning network model. By optimizing imaging parameters (such as micro-focal sources and phase-contrast enhancement) and image preprocessing (such as U-Net intelligent segmentation and multi-angle projection probability fusion), it overcomes the bias of limited information in single-projection images and achieves high-precision intelligent classification. Moreover, it achieves unexpected accuracy in the classification of closely related species and species with different origins, providing a completely new paradigm for seed identification.

[0112] Accurate seed classification plays a crucial role in agricultural breeding, biodiversity conservation, and ecological research. Methods for seed classification are primarily based on external morphological features or the macromolecular structure of species. This patent develops an intelligent seed classification method based on the internal texture of seeds obtained through phase-contrast X-ray single-projection imaging. By combining this method with deep learning, accurate seed classification can be achieved using only a single X-ray projection image, and the method can be implemented efficiently and without loss of quality. To effectively extract feature texture information from seed projection images, a series of X-ray image preprocessing procedures were developed, including flat-field correction, contrast enhancement, image cropping, and segmentation. The Inception-Resnet-V2 network used demonstrates high efficiency in identifying seed samples. Detection results for different types of seed samples show that the classification accuracy (precision or recall) is close to 100%. For seed samples from species with very similar characteristics, precision and recall can also reach 0.96. For test samples from the same species but from different origins, the average precision exceeds 0.95, and the recall exceeds 95%.

[0113] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of the invention. Various variations can be made to the above embodiments of the present invention. All simple and equivalent changes and modifications made in accordance with the claims and description of this application fall within the protection scope of the claims of this patent. All aspects not described in detail in this invention are conventional technical content.

Claims

1. A seed intelligent classification method based on phase-contrast X-ray single projection imaging, characterized in that, include: Step S1: Using different seeds as samples, use an X-ray phase contrast imaging system to acquire single-projection images of the samples at different angles, which will be used as an image dataset. Step S2: Preprocess the single projection image to obtain a preprocessed image dataset; Step S3: Train the deep learning model using the preprocessed image dataset; the deep learning model adopts the Inception-ResNet-V2 network architecture; Step S4: Obtain a single-projection image of the sample to be tested from any angle, preprocess it, and input the preprocessed image into a trained deep learning model for sample classification.

2. The method of claim 1, wherein the method is based on phase-contrast X-ray single-projection imaging. The X-ray phase contrast imaging system includes a microfocus X-ray source, a sample translation stage, and a surface detector arranged in sequence. The sample translation stage is used to mount the sample, which is a seed. The X-ray source, sample translation stage, and surface detector are arranged coaxially, and the sample translation stage and surface detector can move along the optical axis. 3.The seed intelligent classification method based on phase-contrast X-ray single-projection imaging according to claim 1, wherein, In step S1, the acquired single-projection images are used as an image dataset, of which 80% are allocated as a training dataset and 20% as a validation dataset. In addition, seed samples from non-training and validation experiments are used to collect data as a test dataset. In step S3, the preprocessed training dataset and validation dataset are used to train and validate the deep learning model, which is then used to classify samples.

4. The method of claim 1, wherein, Step S1 further includes: performing data augmentation on the image dataset by using at least one of random cropping, brightness enhancement, contrast adjustment, and flipping.

5. The phase-contrast X-ray single-projection imaging based seed intelligent classification method according to claim 1, characterized in that, The preprocessing includes flat and dark field correction, background segmentation, and size normalization.

6. The phase-contrast X-ray single-projection imaging based seed intelligent classification method according to claim 5, characterized in that, The background segmentation employs either a traditional thresholding method or a deep learning-based intelligent image segmentation method. The deep learning-based intelligent image segmentation method specifically includes: selecting the U-net model as the deep learning segmentation network; inputting the single-projection image to be segmented into the deep learning segmentation network, causing the segmentation network to output a binarized segmented image corresponding to the input single-projection image; in the binarized segmented image, the region corresponding to the seed has a value of 1, and the region outside the seed has a value of 0; finally, by multiplying the original single-projection image with the binarized segmented image, the single-projection image after background segmentation is obtained; the loss function of the deep learning model is set to cross-entropy loss.

7. The phase-contrast X-ray single-projection imaging based seed intelligent classification method according to claim 1, characterized in that, In step S4, the classification results obtained from the sample classification include seed type, origin information, or seeds not yet stored. The seed classification method further includes step S5: generating seed type identifiers based on the classification results and issuing warnings for seeds not yet in the database.

8. The phase-contrast X-ray single-projection imaging based seed intelligent classification method according to claim 1, characterized in that, It also includes step S6: When adding a new seed category, a transfer learning strategy is used to dynamically optimize the deep learning model; Step S6 specifically includes: Step S61: Remove the AFDS layer from the original deep learning model and use the weights of the feature extraction network outside the AFDS layer as initialization parameters; Step S62: Add an output node corresponding to the newly added seed category to the original AFDS layer, and correspondingly add the modified AFDS layer to the original feature extraction network to obtain a deep learning network, and fine-tune the deep learning network based on the newly added image data set.

9. A seed intelligent classification system based on phase-contrast X-ray single projection imaging, characterized in that, Comprise: An X-ray phase contrast single projection imaging system configured to take a single projection image of a sample using a seed as the sample; An image preprocessing module for preprocessing the single projection image; A deep learning classification module loaded with a trained deep learning model, wherein the deep learning model adopts an Inception-ResNet-V2 network and is used for classifying the sample; And a result output module generates a seed type identification according to the classification result obtained by classifying the sample, and warns the non-warehouse seed.

10. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the computer program implements the seed intelligent classification method based on phase contrast X-ray single projection imaging according to any one of claims 1-8.