Intelligent seed quality detection system based on big data
By combining deep convolutional neural networks and tensor ring decomposition algorithms, the problem of insufficient robustness in seed appearance quality detection is solved, and high-precision grading of complex textures and irregular defects is achieved, thereby improving the adaptability and accuracy of the detection system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NUWA GOD GRASS IN SHAANXI PROVINCE AGRI SCI & TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies rely on manually designed shallow features when dealing with complex and ever-changing seed appearance quality inspection. These features are not robust and are difficult to effectively extract high-order correlation information, resulting in the loss of feature information. In particular, when faced with complex seed surface textures and irregular defect morphologies, the detection accuracy is not high.
A deep convolutional neural network model based on multi-scale attention mechanism and strong homogeneity constraint is adopted. The seed image is deconstructed into superpixel blocks through the segmentation module. Combined with the tensor ring decomposition algorithm, a saliency map of appearance defects is generated, and the seed defect index is quantified and classified.
It significantly improves the robustness of detecting complex textures and irregular defect seeds, enables accurate and automated grading, reduces reliance on prior knowledge of specific defect morphologies, and improves the adaptability and accuracy of the detection system.
Smart Images

Figure CN121504914B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of agricultural detection, and particularly relates to a seed quality intelligent detection system based on big data. BACKGROUND
[0002] As the basis of agricultural production, the quality of seeds is directly related to the yield and quality of crops. With the development of modern agricultural technology, a seed quality intelligent detection system based on big data has emerged as the times require. The system is mainly used to replace traditional manual screening. Through image acquisition, data analysis and pattern recognition, the appearance quality (such as shape, color, texture, etc.) of seeds is automatically detected and graded non-destructively, thereby improving the efficiency and accuracy of good seed breeding.
[0003] Chinese patent CN 118982498 A discloses a seed quality detection method based on spectral technology. The technical solution introduces a directionality factor, uses the specific directionality (such as band-like extension) of the defect area on the image to distinguish from the cluster-like difference of the nutrient area, and finally calculates the region similarity by combining color similarity and directionality factor, so as to evaluate the empty package degree of the seed. This method attempts to introduce geometric direction features by constructing a mathematical model, which to some extent solves the problem that it is difficult to distinguish internal nutrient components from external empty package defects simply by relying on color threshold. However, the above prior art still has many limitations in dealing with complex and variable seed appearance quality detection. This method mainly relies on artificial design of shallow features, and is too dependent on prior knowledge for feature extraction. When facing the situation of complex seed surface texture, irregular defect morphology such as randomly distributed mildew spots, tiny mechanical scratches or no obvious directionality features, the robustness of this method is poor. This technology only performs pixel-level statistical calculation in the low-dimensional RGB color space, and fails to fully exploit the high-order correlation information contained in the image data. The seed image data essentially has high-dimensional characteristics, and simple two-dimensional matrix operation or low-order statistics cannot effectively represent the complex spatial structure and texture details between pixels, which is easy to cause the loss of feature information. SUMMARY
[0004] The technical problems solved by the present application are: there are still many limitations in processing complex and variable seed appearance quality detection, the method mainly relies on artificial design of shallow features, and the extraction of features is too dependent on prior knowledge, and the robustness of the method is poor when facing complex seed surface texture, irregular defect morphology such as randomly distributed mold spots, tiny mechanical scratches or no obvious directional features; the technology only performs pixel-level statistical calculation in a low-dimensional RGB color space, and fails to fully exploit the high-order correlation information contained in the image data, and the seed image data essentially has high-dimensional characteristics, so simple two-dimensional matrix operation or low-order statistics cannot effectively represent the complex spatial structure and texture details between pixels, which easily leads to the loss of feature information.
[0005] To solve the above technical problems, the present application provides the following technical scheme: a seed quality intelligent detection system based on big data, comprising an acquisition module, a segmentation module, an estimation module and a management module;
[0006] The acquisition module is used for acquiring appearance image data of seeds and performing preprocessing;
[0007] The segmentation module is used for deconstructing the appearance image data of the preprocessed seeds into superpixel blocks through a pre-trained deep convolutional neural network model based on a multi-scale attention mechanism and a homogeneity strong constraint;
[0008] The estimation module is used for extracting high-dimensional features of the superpixel blocks and converting them into tensor representation, performing low-rank decomposition on the high-dimensional feature tensor based on a tensor ring decomposition algorithm, and generating an appearance defect saliency map by calculating the reconstruction error between the original feature tensor and the reconstructed tensor;
[0009] The management module is used for quantifying seed defect indicators according to the appearance defect saliency map and grading in combination with a preset quality standard.
[0010] Preferably, the appearance image data is real-time collected appearance image data of crop seeds to be detected;
[0011] The preprocessing includes uniform resolution adjustment and normalization processing of the appearance image data, to obtain preprocessed appearance image data;
[0012] The uniform resolution adjustment includes adjusting the resolution of all appearance RGB images to a standard input resolution size through an industrial camera to collect the appearance RGB images of the seeds;
[0013] The normalization processing is to standardize the image pixel values.
[0014] Preferably, the deep convolutional neural network model comprises a feature encoder, a feature pyramid attention unit, a feature decoder and a region division prediction head;
[0015] The feature encoder comprises a shallow convolutional layer and a deep convolutional layer, and the initialized image data is input into the shallow convolutional layer to obtain a shallow feature map, and the shallow feature map is input into the deep convolutional layer to generate a deep feature map.
[0016] The initialized image data is obtained by performing an initialization operation on the preprocessed appearance image data, and the initialization operation comprises: dividing the preprocessed appearance image data into a plurality of rectangular grid units according to a preset superpixel sampling interval, and defining the geometric center coordinates of each rectangular grid unit as a potential superpixel center.
[0017] Preferably, the feature pyramid attention unit comprises parallel branch 1, branch 2 and branch 3, and the processing logic of the branch 1, branch 2 and branch 3 comprises: inputting the deep feature map into the branch 1, branch 2 and branch 3 respectively for convolution operation to obtain local micro-skin spot features, medium scale features and macro outline features respectively, and splicing the local micro-skin spot features, medium scale features and macro outline features through a channel dimension to obtain a multi-scale feature tensor.
[0018] The feature pyramid attention unit further comprises a channel attention weighting layer, and the processing logic of the channel attention weighting layer comprises: performing pooling, convolution and activation operations on the multi-scale feature tensor through the channel attention weighting layer to obtain a weight vector for each feature channel, and performing element-wise multiplication on the multi-scale feature tensor and the weight vector to output an enhanced feature map.
[0019] Preferably, the processing logic of the feature decoder comprises: inputting the enhanced feature map into the feature decoder for bilinear interpolation upsampling and magnifying, and performing element-wise addition on the magnified enhanced feature map and the shallow feature map to obtain a pixel-level feature mapping map.
[0020] The processing logic of the region division prediction head comprises: after the pixel-level feature mapping map is subjected to convolution operation, a Softmax activation function is used to output an attribution probability matrix with a channel number of 9, and an element of the attribution probability matrix represents a probability that each pixel point in the preprocessed image data belongs to 9 potential superpixel centers in a surrounding 3x3 neighborhood.
[0021] Preferably, the deep convolutional neural network is pre-trained by minimizing a composite loss function.
[0022] The composite loss function comprises a homogeneity constraint term and a spatial compactness loss term.
[0023] The mathematical expression of the loss function is:
[0024] ;
[0025] wherein, a spatial compactness loss term, a homogeneity constraint term, a preset parameter;
[0026] The homogeneity constraint term is an Euclidean distance between a pixel feature vector inside a superpixel region and a cluster center feature vector of the region.
[0027] The mathematical expression of the homogeneity constraint term is:
[0028] ;
[0029] wherein, a homogeneity constraint term, a global index of a potential superpixel center, taking a value of 1 to A, A being a total number of grid divisions of a whole image, and p being a pixel surrounded by nine potential superpixel centers, a feature vector of a pixel inside a superpixel region, indicating a square of L2 norm, a probability of the pixel p belonging to k, a feature vector of a cluster center;
[0030] The mathematical expression of the feature vector of the cluster center is:
[0031] ;
[0032] wherein, traversing each pixel point in the initialized appearance image data, a global index of a potential superpixel center, taking a value of 1 to A, A being a total number of grid divisions of a whole image, a probability of the pixel belonging to k, a feature vector of the pixel on a pixel-level feature mapping graph;
[0033] The spatial compactness loss term is an Euclidean distance between a spatial coordinate of a pixel and a superpixel spatial center.
[0034] The mathematical expression of the spatial compactness loss term is:
[0035] ;
[0036] wherein, a spatial compactness loss, a global index of a potential superpixel center, taking a value of 1 to A, A being a total number of grid divisions of a whole image, belonging to the same superpixel belonging to the same superpixel the probability belonging to the same superpixel inherent spatial coordinates of the pixel;
[0037] The obtaining of the pre-trained deep convolutional neural network model comprises: training the deep convolutional neural network model using a training set, verifying using a verification set, iteratively updating network parameters of the deep convolutional neural network model, and solidifying the network parameters after the training is completed.
[0038] Preferably, the estimation module comprises a feature tensorization unit configured to construct a high-order feature tensor.
[0039] The process of constructing the high-order feature tensor comprises: obtaining a belonging probability matrix from the pre-trained deep convolutional neural network, comparing nine probability values of each pixel in the belonging probability matrix, selecting an index of a channel with the largest probability value as a belonging number of the pixel, and generating a superpixel index map.
[0040] All pixels belonging to the same belonging number are obtained from the superpixel index map, and feature vectors of the pixels belonging to the same belonging number are spliced to obtain a feature matrix.
[0041] Each order statistical moment of the feature matrix is calculated, and the statistical moments are constructed into a statistical feature vector.
[0042] The statistical moments comprise a mean, a variance, a skewness, and a kurtosis.
[0043] The statistical feature vector is mapped into a high-order feature tensor according to a tensor dimension mapping rule.
[0044] The tensor dimension mapping rule comprises:
[0045] An order number and a dimension of each order number of the high-order feature tensor are set, and a product of all the dimensions of the order numbers is a total capacity.
[0046] Elements in the statistical feature vector are filled into the order numbers of the high-order feature tensor.
[0047] If a length of the statistical feature vector is equal to the total capacity, the elements in the statistical feature vector are filled into the dimensions of the order numbers in a row priority order.
[0048] If the length of the statistical feature vector is less than the total capacity, elements with a value of zero are filled at the end of the statistical feature vector until the length is equal to the total capacity, and then the elements are filled into the dimensions of the order numbers in the row priority order.
[0049] If the length of the statistical feature vector is greater than the total capacity, the order number and the dimension of each order number of the high-order feature tensor are adjusted until the length of the statistical feature vector is less than or equal to the total capacity, and then the filling operation is performed.
[0050] Preferably, the estimation module further comprises a decomposition calculation unit configured to construct an objective function for minimizing reconstruction error, and decompose the high-order feature tensor into tensor ring core factors by using an alternating least squares method;
[0051] The expression of the objective function is as follows:
[0052]
[0053] wherein, represents a Frobenius norm, represents a trace of a chain product of core tensors, is an order of the high-order feature tensor, is the high-order feature tensor;
[0054] The process of obtaining the core tensors comprises:
[0055] According to a preset rank vector, a topological structure of the tensor ring is determined, a plurality of core tensors to be solved are constructed in the topological structure, and numerical initialization is performed on the core tensors other than the first core tensor by using a random distribution strategy;
[0056] The objective function is updated by using the alternating least squares method in a loop until a preset convergence condition is met, and the tensor ring core factors are output.
[0057] Preferably, the estimation module generates an appearance defect saliency map by calculating reconstruction error;
[0058] The reconstruction error calculation process comprises: reconstructing an approximate tensor by using the low-rank tensor ring core factors, and calculating a Frobenius norm between the original high-order feature tensor and the approximate tensor;
[0059] The generation process comprises: assigning the Frobenius norm as an abnormality measurement value to a pixel region covered by the corresponding superpixel block.
[0060] Preferably, the hierarchical strategy of the management module comprises a defect area proportion index and a defect severity index of a seed appearance defect saliency map;
[0061] The defect area proportion index is obtained by calculating a proportion of defect pixels to total pixels after binarization segmentation of the appearance defect saliency map;
[0062] The defect severity index is obtained by integrating reconstruction error values of defect pixels in the appearance defect saliency map and taking an average value;
[0063] The management module outputs a sorting control instruction according to the area proportion index and the defect severity index.
[0064] The application provides a seed quality intelligent detection system based on big data, which significantly improves the detection robustness of complex textures and irregular defects of seeds compared with prior art, and the core advantage is that a tensor ring decomposition algorithm and a deep superpixel segmentation mechanism are introduced, high-order feature tensors are constructed, the system can fully mine the correlation between high-order spatial structures and texture details of pixels in seed appearance images, the low-rank approximation characteristics of tensor ring decomposition are used to effectively separate normal seed textures (low-rank components) and defects such as mildew and scratches (high-rank sparse components) distributed at random, the unsupervised or semi-supervised abnormality detection logic based on reconstruction error greatly reduces the dependence on prior knowledge of specific defect morphology, even if small spots or disordered textures without obvious direction are faced, a high-precision appearance defect saliency map can be generated by quantifying the difference between the original tensor and the reconstructed tensor, so that accurate and automatic grading of seed quality is realized, a deep learning network with a multi-scale attention mechanism and homogeneity strong constraint is used in the image deconstruction level, the problems of poor edge fitting and loss of semantic information of traditional superpixel algorithms in processing complex agricultural images are solved, the design of the feature pyramid attention unit enables the network to extract local small spots, medium-scale textures and macro contour features in parallel, the channel attention weighted enhances the expression ability of effective features, and the composite loss function containing the spatial compactness and homogeneity constraint forces the superpixel blocks generated by the network to closely fit the irregular defect boundaries while maintaining the internal texture consistency, the coupling architecture of deep feature extraction and tensor low-rank analysis not only improves the adaptability of the detection system to multiple defect types, but also ensures the efficient landing and accurate execution of the algorithm model on the actual agricultural production line through standardized tensor dimension mapping and industrial-level sorting instruction output. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 A basic flowchart of a seed quality intelligent detection system based on big data provided by an embodiment of the application is shown. DETAILED DESCRIPTION
[0066] In order to make the above-mentioned objects, features and advantages of the application more obvious and easy to understand, the specific embodiments of the application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments.
[0067] Embodiments, with reference to Figure 1 , provide a seed quality intelligent detection system based on big data, which comprises an acquisition module, a segmentation module, an estimation module and a management module.
[0068] An acquisition module is configured to acquire appearance image data of the seeds and perform preprocessing;
[0069] A segmentation module is configured to decompose the preprocessed appearance image data of the seeds into superpixel blocks by using a pre-trained deep convolutional neural network model based on a multi-scale attention mechanism and a homogeneity strong constraint;
[0070] An estimation module is configured to extract high-dimensional features of the superpixel blocks and convert them into tensor representation, perform low-rank decomposition on the high-dimensional feature tensor based on a tensor ring decomposition algorithm, and generate an appearance defect saliency map by calculating reconstruction error between the original feature tensor and the reconstructed tensor;
[0071] A management module is configured to quantify a seed defect index according to the appearance defect saliency map and grade in combination with a preset quality standard.
[0072] The present application builds a complete end-to-end intelligent detection system through the cooperative work of the acquisition module, the segmentation module, the estimation module and the management module, which is different from the traditional detection based on threshold or simple morphology. The present application uses a deep convolutional neural network based on a multi-scale attention mechanism to decompose the image into superpixel blocks, and combines a tensor ring decomposition algorithm for defect estimation. The present application can improve the image processing from pixel level to superpixel level tensor analysis, which not only retains local texture information, but also captures deep correlations between data by using the high-dimensional characteristics of tensors, significantly improves the recognition accuracy of small, irregular and complex texture defects, and solves the problem of poor robustness of the prior art when facing random mold or small scratches.
[0073] The appearance image data is real-time acquired appearance image data of the crop seeds to be detected;
[0074] The preprocessing includes uniform resolution adjustment and normalization processing of the appearance image data, to obtain preprocessed appearance image data;
[0075] The uniform resolution adjustment includes adjusting the resolution of all appearance RGB images to a standard input resolution size by acquiring the appearance RGB images of the seeds through an industrial camera;
[0076] The normalization processing is to standardize the image pixel values.
[0077] In one specific embodiment of the present application, the standard input resolution size is .
[0078] The deep convolutional neural network model includes a feature encoder, a feature pyramid attention unit, a feature decoder and a region division prediction head;
[0079] The feature encoder comprises a shallow convolutional layer and a deep convolutional layer, and the initialized image data is input into the shallow convolutional layer to obtain a shallow feature map, and the shallow feature map is input into the deep convolutional layer to generate a deep feature map.
[0080] The initialized image data is obtained by performing an initialization operation on the preprocessed appearance image data, and the initialization operation comprises: dividing the preprocessed appearance image data into a plurality of rectangular grid units according to a preset superpixel sampling interval, and defining the geometric center coordinates of each rectangular grid unit as a potential superpixel center.
[0081] The deep convolutional neural network comprises a feature encoder, a feature pyramid attention unit and the like, and the superpixels are initialized by using a grid center, the deep and shallow convolutional features are fused, and compared with traditional manual feature extraction, more discriminative semantic features can be automatically learned, the grid initialization mode ensures the spatial uniformity of the superpixel generation, avoids the segmentation fragmentation caused by the randomness of the initial clustering, and lays an accurate spatial foundation for subsequent high-order feature extraction.
[0082] The feature pyramid attention unit comprises parallel branch 1, branch 2 and branch 3, and the processing logic of the branch 1, the branch 2 and the branch 3 comprises: inputting the deep feature map into the branch 1, the branch 2 and the branch 3 respectively for convolution operation, to obtain local micro-skin spot features, medium scale features and macro outline features respectively, and splicing the micro-skin spot features, the medium scale features and the macro outline features through a channel dimension to obtain a multi-scale feature tensor;
[0083] The feature pyramid attention unit further comprises a channel attention weighting layer, and the processing logic of the channel attention weighting layer comprises: performing pooling, convolution and activation operations on the multi-scale feature tensor through the channel attention weighting layer to obtain a weight vector for each feature channel, and performing element-wise multiplication on the multi-scale feature tensor and the weight vector to output an enhanced feature map.
[0084] The feature pyramid attention unit comprising parallel three branches is designed, micro-skin spots, medium scale and macro outline features are extracted respectively, and channel attention weighting is introduced, so that the problem that a single scale convolution kernel cannot simultaneously consider the seed surface micro pinhole and the large area mold is solved, through the splicing and attention weighting of the multi-scale features, the model can automatically suppress the background noise such as the light and shadow of the seed edge, and focus on the key channel with defect semantics, so that the richness and pertinence of feature expression are significantly improved.
[0085] The processing logic of the feature decoder comprises: inputting the enhanced feature map into the feature decoder for bilinear interpolation upsampling and magnification, and performing element-wise addition on the magnified enhanced feature map and the shallow feature map to obtain a pixel-level feature mapping map.
[0086] The region division prediction head processing logic comprises: after the pixel-level feature mapping is subjected to a convolution operation, a Softmax activation function is used to output a belonging probability matrix with 9 channels, and the elements of the belonging probability matrix represent the probability that each pixel in the preprocessed image data belongs to 9 potential superpixel centers in a surrounding 3*3 neighborhood.
[0087] The present application represents pixel belonging by means of a probability matrix instead of hard cutting, retains the fuzzy information of edges, makes the gradient smoother during back propagation training, and combines the skip connection of deep and shallow features, so that the finally generated superpixel block boundary is not only semantically accurate, but also accurately fits the physical edge of the seed, reducing the influence of segmentation error on subsequent feature statistics.
[0088] The deep convolutional neural network is pre-trained by minimizing a composite loss function;
[0089] The composite loss function comprises a homogeneity constraint term and a spatial compactness loss term;
[0090] The mathematical expression of the loss function is:
[0091] ;
[0092] Among them, the spatial compactness loss term, the homogeneity constraint term, and the preset parameter;
[0093] The homogeneity constraint term is the Euclidean distance between the pixel feature vector inside the superpixel region and the cluster center feature vector of the region;
[0094] The mathematical expression of the homogeneity constraint term is:
[0095] ;
[0096] Among them, the homogeneity constraint term, represents the global index of the potential superpixel center, and takes a value of 1~A, A being the total number of grid division of the whole image, is a set composed of 9 potential superpixel centers around the pixel , is the feature vector of the pixel inside the superpixel region, represents the square of the L2 norm, is the probability that the pixel p belongs to k, is the feature vector of the cluster center;
[0097] The mathematical expression of the feature vector of the cluster center is:
[0098] ;
[0099] wherein, traversing each pixel point in the initialized appearance image data, representing a global index of the latent superpixel center, taking values from 1 to A, A being the total number of grid divisions of the whole image, is the probability of pixel belonging to ; is the feature vector of pixel on the pixel-level feature map;
[0100] The spatial compactness loss term is the Euclidean distance between the spatial coordinates of the pixel and the spatial center of the superpixel;
[0101] The mathematical expression of the spatial compactness loss term is:
[0102] ;
[0103] wherein, is the spatial compactness loss, representing a global index of the latent superpixel center, taking values from 1 to A, A being the total number of grid divisions of the whole image, is the probability of pixel belonging to ; is the intrinsic spatial coordinates of pixel ;
[0104] The pre-trained deep convolutional neural network model is obtained by: training the deep convolutional neural network model using a training set, verifying using a verification set, iteratively updating the network parameters of the deep convolutional neural network model, and solidifying the network parameters after training is completed.
[0105] The homogeneity constraint of the application forces the pixel features within the same superpixel to be highly similar, thereby separating the defect region and the healthy region in the feature space, and the spatial compactness loss prevents the superpixel shape from being excessively distorted into a strip or a dendritic shape, ensuring the compactness of the generated superpixel block in the physical space, which is conducive to the numerical stability when calculating and counting the moments subsequently, and realizes the balance between the segmentation accuracy and the shape regularity.
[0106] In one specific embodiment of the application, the preprocessed appearance image data (with a size of ) is first initialized, and the superpixel sampling interval is set to 16, i.e., the image is evenly divided into rectangular grid units;
[0107] is the probability of pixel the pre-processed image input feature encoder, through shallow convolution (stage 1-2), the shallow convolution includes two consecutive convolution layers (64 convolution kernels, step 1), to generate a shallow feature map , size , the shallow feature map is cached for subsequent residual connection;
[0108] The shallow feature map is input to deep convolution (stage 3-4), down-sampled through a max-pooling layer (step 2), and then passed through three stacked convolution layers (64 convolution kernels), to generate a deep feature map , size reduced to ;
[0109] The feature pyramid attention unit includes parallel branch 1, branch 2 and branch 3, the deep feature map is input to branch 1 through convolution to extract local micro-lesion features, the deep feature map is input to branch 2 through convolution to extract medium-scale features, and the deep feature map is input to branch 3 through convolution to extract macroscopic contour features, the outputs of the three branches are concatenated in the channel dimension to obtain a multi-scale feature tensor ;
[0110] The multi-scale feature tensor is input to the channel attention weighting layer, processed through global average pooling, convolution, and then processed through Sigmoid activation to generate a weight vector for each feature channel;
[0111] The multi-scale feature tensor is element-wise multiplied by the weight vector to output an enhanced feature map ;
[0112] The enhanced feature map is input to the feature decoder for bilinear interpolation up-sampling, and the size is restored to ;
[0113] The feature decoder is introduced, the cached shallow feature map is element-wise added to the up-sampled through a jump connection to obtain a pixel-level feature mapping ;
[0114] is a three-dimensional matrix (64 is the feature dimension) with a size of ; any coordinate point in the image The corresponding vector is the pixel feature vector in the following formula ;
[0115] The input is input to the region division prediction head, and after the convolutional layer, the Softmax activation function, and the output channel number is 9 (corresponding to a 3x3 neighborhood) belonging probability matrix , the belonging probability matrix represents the probability of each pixel point in the image belonging to the 9 potential superpixel centers in its surrounding 3x3 neighborhood.
[0116] That is, the element in the belonging probability matrix represents the probability of the pixel with coordinates belonging to the corresponding potential superpixel center of its first relative spatial neighbor .
[0117] In order to train the deep neural network, a composite loss function is constructed, and in a single forward propagation, the composite loss function is calculated as follows:
[0118] Based on the belonging probability matrix and the pixel-level feature map , the feature center vector of each potential superpixel center in the entire image is calculated using the weighted average method as the clustering center feature vector, and the calculation formula of the clustering center feature vector is as follows:
[0119] ;
[0120] wherein traverses each pixel point in the image, represents the global index of the potential superpixel center, taking values from 1 to A, A being the total number of grids divided in the entire image, is the probability of pixel belonging to (the probability value is obtained by querying the relative neighborhood channel of the center corresponding to the pixel in the matrix , if is not within the neighborhood of , ), is the pixel in the pixel-level feature map the feature vector of the pixel, the step will initialize the weighted average of the pixel features of all potential superpixel centers in the appearance image data that may belong to the first potential superpixel center, to obtain the average feature of the superpixel center, i.e. the clustering center, is the weighted feature sum, is the total area of the effective pixels;
[0121] The Euclidean distance between the feature of all pixel points and the feature corresponding to the superpixel center is calculated, and the calculation formula of the Euclidean distance is:
[0122] ;
[0123] wherein, is the Euclidean distance between the feature of all pixel points and the feature corresponding to the superpixel center, is the set of 9 potential superpixel centers around the pixel is the feature of the pixel , and represents the square of the L2 norm, is the probability that the pixel belongs to ;
[0124] The Euclidean distance between the feature of all pixel points and the superpixel center to which it belongs is calculated to force the feature consistency within the same superpixel, and the calculation formula of the Euclidean distance is:
[0125] ;
[0126] wherein, is the set of 9 potential superpixel centers around the pixel , and represents the square of the L2 norm (Euclidean distance), is the probability that the pixel belongs to ;
[0127] In order to prevent the superpixel shape from being too distorted, a spatial compactness loss is introduced, which is used to calculate the distance between the spatial coordinates of the pixel and the spatial center of the superpixel , and the mathematical expression of the spatial compactness loss is:
[0128] ;
[0129] wherein, is the compactness loss, is the inherent spatial coordinate of the pixel, is the probability that the pixel belongs to the superpixel, is the inherent spatial coordinate of the pixel, is the spatial center coordinate of the superpixel,
[0130] The update formula of is:
[0131]
[0132] is the inherent spatial coordinate of the pixel, is the probability that the pixel belongs to the superpixel,
[0133] The Kaiming initialization method is used to initialize the parameters of the convolutional layer, and the Adam optimizer is used. The function of the optimizer is to automatically adjust the weight parameters and bias of each convolutional kernel in the network according to the calculated total loss, so that the loss value in the next forward propagation is smaller. The initial learning rate of the Adam optimizer is set to 0.001. The training set image is input into the network in batches, and the total loss function is calculated. The mathematical expression of the total loss function is:
[0134]
[0135] is the spatial compactness loss, is the homogeneity constraint term, in this embodiment, is 100, used to balance the weight and emphasize the importance of homogeneity. The optimizer calculates the gradient according to the loss value, updates the network parameters, and stops training when the iteration number reaches 300,000 or the segmentation accuracy on the validation set no longer improves. After training is completed, the network parameters are solidified (i.e., the trained model weight is saved), and the network is the segmentation module.
[0136] The preprocessed seed image is input into the segmentation module, and the output is the attribution probability matrix of the preprocessed seed image.
[0137]
[0138] The training and validation sets used for training were constructed by batch-collecting raw appearance images of the seeds using an industrial camera, with the image resolution uniformly adjusted. The collected images, including seed samples with different appearance quality characteristics (normal fullness, mechanical damage, mold, insect infestation, and abnormal shape), were used to perform pixel-level semantic segmentation annotation using a professional image annotation tool (LabelMe). The annotation process involved dividing regions in the image into specific semantic categories and assigning specific pixel values to each category (e.g., background = 0, healthy = 1, mold = 2, damaged = 3). After annotation, a single-channel semantic segmentation mask with the same size as the original image was generated as label data. The processed paired data {RGB image, semantic segmentation mask} were randomly divided into training and validation sets at a 4:1 ratio. During training, the data was batch-input into the network in the form of tensors, with the input data being of shape... Image tensors ( (For batch size, e.g., 8), the corresponding label is the shape. The mask tensors are fed into the network to calculate the feature reconstruction loss and homogeneity constraint loss, thereby driving the iterative update of the network parameters.
[0139] The estimation module includes a feature tensor quantization unit, used to construct higher-order feature tensors;
[0140] The process of constructing a high-order feature tensor includes: obtaining the attribution probability matrix through a pre-trained deep convolutional neural network, comparing the nine probability values of each pixel in the attribution probability matrix, selecting the index of the channel with the highest probability value as the pixel's attribution number, and generating a superpixel index map.
[0141] Obtain all pixels belonging to the same index from the superpixel index map, and concatenate the feature vectors of pixels with the same index to obtain the feature matrix;
[0142] Calculate the statistical moments of each order of the feature matrix, and construct statistical eigenvectors from the statistical moments of each order;
[0143] Statistical moments of each order include mean, variance, skewness, and kurtosis;
[0144] According to the tensor dimension mapping rule, statistical feature vectors are mapped to higher-order feature tensors;
[0145] Tensor dimension mapping rules include:
[0146] Define the order and dimension of the higher-order feature tensor; the product of the dimensions of all orders is the total capacity.
[0147] Fill the elements in the statistical feature vector into the order of the higher-order feature tensor;
[0148] If the length of the statistical feature vector is equal to the total capacity, the elements in the statistical feature vector are filled in the dimension of each order in row priority order;
[0149] If the length of the statistical feature vector is less than the total capacity, elements with a value of zero are filled at the end of the statistical feature vector until the length is equal, and then filled in the dimension of each order in row priority order;
[0150] If the length of the statistical feature vector is greater than the total capacity, the order of the preset set high-order feature tensor and the dimension of each order are adjusted until the length of the statistical feature vector is less than or equal to the total capacity, and then the filling operation is performed.
[0151] In a specific embodiment of the present application, the initialized appearance image data is input into a pre-trained deep convolutional neural network to obtain the belonging probability matrix of the initialized appearance image (size ), and the 9 probability values of each pixel position in the matrix are compared, and the channel index with the maximum probability is selected as the belonging number of the pixel, thereby generating a superpixel index map (size ), wherein the value of each pixel in the map is an integer from to , representing the superpixel center it belongs to;
[0152] There are superpixel blocks in total, starting from 1, and the following operations are performed one by one for the current superpixel block:
[0153] Find all pixel coordinates with index value in , and extract the corresponding feature vectors from the pixel-level feature mapping map , arrange these feature vectors in rows to construct a feature matrix (size , wherein is the number of pixels in the block, is the feature dimension);
[0154] In order to obtain the overall statistical distribution characteristics of the superpixel block and unify the data size, calculate the statistical moments including mean, variance, skewness and kurtosis of the feature matrix to generate a one-dimensional statistical feature vector , and the length of the statistical feature vector is denoted as ;
[0155] In order to convert the one-dimensional feature into a tensor structure that can capture high-order correlations, a tensor dimension mapping rule is used to construct a high-order feature tensor The tensor dimension mapping rule is as follows:
[0156] Set the order of the target higher-order tensor to be (In this embodiment) ), and set the dimensions of each dimension as follows: (All are 4), their total capacity (e.g., 256).
[0157] If statistical eigenvectors length Exactly equal to the total capacity Then directly fill the vector elements in row-major order to... ;
[0158] If length Less than the total capacity Then, fill the end of the vector with elements of zero value until the length reaches [the specified value]. Then perform the fill operation;
[0159] If length Greater than the total capacity Then, the preset size is dynamically adjusted (by increasing the value of a certain dimension) so that its total capacity can accommodate all feature data;
[0160] After the above mapping, a standardized high-order feature tensor is obtained. .
[0161] This invention uses higher-order statistics to replace single pixel values, which can more comprehensively describe the texture distribution of the seed surface. By using tensor dimension mapping rules to upgrade one-dimensional vectors to higher-order tensors, subsequent processing can use tensor algebra tools to capture potential higher-order coupling relationships between features, such as joint distribution anomalies of color and texture, which is impossible to achieve with traditional two-dimensional matrix methods.
[0162] The estimation module also includes a decomposition calculation unit, which constructs an objective function that minimizes the reconstruction error and uses the alternating least squares method to decompose the high-order feature tensor into tensor ring core factors.
[0163] The expression for the objective function is:
[0164] ;
[0165] in, Denotes the Frobenius norm. The trace of the chained product of the core tensors. Let the order be the higher-order feature tensor. It is a higher-order feature tensor;
[0166] The process of obtaining the core tensor includes:
[0167] The topology of the tensor ring is determined based on the preset rank vector, and multiple core tensors to be solved are constructed in the topology. A random distribution strategy is used to numerically initialize the remaining core tensors except for the first core tensor.
[0168] The objective function is iteratively updated using the alternating least squares method until the preset convergence condition is met, and the core factor of the tensor ring is output.
[0169] In a specific embodiment of the present invention, the higher-order feature tensor The process of transforming into a low-rank tensor ring core factor involves constructing a minimum objective function:
[0170] ;
[0171] in, Denotes the Frobenius norm. Represents the reconstruction operation of the tensor ring (i.e., the trace of the chained product of the core tensors).
[0172] Define the rank vector of the tensor ring. (In this embodiment, in order to balance compression ratio and feature retention, the following settings are made:) );
[0173] Based on the set rank, initialize four third-order core tensors, excluding the first core tensor. In addition, the other three core tensors , Initialized randomly using a Gaussian distribution. It will not be initialized yet, and will be used as the solution object in the first iteration;
[0174] Enter the iterative loop, updating each core tensor sequentially until convergence, to update the th core tensor. One core tensor For example ( ):
[0175] Fixed removal For the other three core tensors, calculate the partial contraction product of these three core tensors. Specifically, ... , , , Perform tensor multiplication operations sequentially to generate an intermediate auxiliary matrix. The intermediate auxiliary matrix represents the background feature field of the entire tensor ring network, excluding the current node, and transforms the original high-order feature tensor... Along the first Each modality is expanded and reshaped into an observation matrix. The original high-order tensor approximation problem is converted into a linear least square problem about the current core tensor ;
[0176] ;
[0177] The linear equations are directly solved by using the matrix pseudo-inverse to obtain the current optimal update value :
[0178] ;
[0179] wherein denotes the pseudo-inverse operation, is an observation matrix, is a matrix representation of the th tensor ring core factor ;
[0180] In order to prevent numerical calculation overflow, the updated is normalized. The normalization is to obtain the Frobenius norm of , and the Frobenius norm of is taken as a scaling factor. The normalized is obtained by dividing by the scaling factor, that is ;
[0181] The above fixed update step is repeated to update to . After each iteration, the current reconstruction error is calculated. When the reduction of the reconstruction error of two adjacent iterations is less than a preset threshold (in this embodiment, 10 ) or the maximum number of iterations (in this embodiment, 10 times) is reached, the iteration is stopped.
[0182] The scaling factors of each iteration are multiplied to obtain a total scaling ratio. The total scaling ratio is multiplied by any one of the previously normalized core tensors to output the final four core tensor factors . This set of tensors is the optimal low-rank tensor representation of the texture features of the pixel block.
[0183] Tensor ring decomposition has superior compression performance and expression ability than traditional CP decomposition or Tucker decomposition. By finding low-rank core factors, the algorithm actually learns the general texture model of normal seeds. Since defects (such as mold points) destroy the global correlation and low-rank structure of the image, they cannot be well represented by low-rank core factors. Therefore, this decomposition process provides a mathematical basis for efficient and accurate anomaly detection, and the alternating least squares method ensures the convergence and computational efficiency of the solution.
[0184] The estimation module generates a saliency map of appearance defects by calculating the reconstruction error;
[0185] The reconstruction error calculation process includes: reconstructing the approximate tensor using the core factor of the low-rank tensor ring, and calculating the Frobenius norm between the original high-order feature tensor and the approximate tensor;
[0186] The generation process includes: assigning the Frobenius norm as an anomaly metric to the pixel region covered by the corresponding superpixel block.
[0187] In one specific embodiment of the present invention, statistical feature vectors The first in Value ( The restoration process includes restoring the one-dimensional index. Mapped to four-dimensional coordinate index The mapping relationship is ;
[0188] Based on the coordinate indices, the corresponding slice matrices are extracted from the four core factors, where, , , , ;
[0189] Perform chain multiplication and trace operation on the slice matrix to directly calculate the moment value at that position. The moment value calculation process is as follows:
[0190] ;
[0191] in, For approximate tensors, (•) is the trace operation. ~ To extract the corresponding slice matrix from the four core factors, all indices are traversed to calculate the complete slice matrix. ;
[0192] Calculate the original higher-order feature tensor With the reconstructed approximate tensor The difference between them is defined as the reconstruction error. The formula for calculating the reconstruction error is:
[0193] ;
[0194] This formula represents summing the squares of the differences between the values of two tensors at each corresponding position and then taking the square root.
[0195] like A smaller value indicates that the texture of this area conforms to the low-rank rule and tends to belong to a normal seed surface;
[0196] If the value is larger, it indicates that the region is textured and cannot be fitted by the low-rank model, and tends to belong to the quality defect region;
[0197] The calculated reconstruction error is mapped back to the image space, and according to the index information provided by the segmentation module, all pixel coordinate sets covered by the current superpixel block in the original image are found ;
[0198] For each pixel point in the set , its pixel value is assigned as :
[0199] After all the superpixel blocks in the whole image complete the above calculation and assignment, the final gray image is output as the seed appearance defect saliency map.
[0200] The reconstruction error of the present application directly quantifies the degree of deviation of the current region from the normal low-rank texture, converts the abstract mathematical error into a visual saliency map, and can intuitively and finely locate the defect position, and has strong generalization detection ability for various unknown or rare defects.
[0201] The hierarchical strategy of the management module includes a defect area ratio index and a defect severity index of the seed appearance defect saliency map;
[0202] The defect area ratio index is obtained by binarizing the appearance defect saliency map and calculating the proportion of defect pixels to total pixels;
[0203] The defect severity index is obtained by integrating the reconstruction error values of the defect pixels in the appearance defect saliency map and taking the average;
[0204] The management module outputs a sorting control instruction according to the area ratio index and the defect severity index.
[0205] In a specific embodiment of the present application, the seed appearance defect saliency map (gray image, pixel value representing abnormality measure value size, i.e. deviation from healthy state) and the original physical size information of the seed are received;
[0206] Set the response threshold (in this embodiment , empirical value), binarize the saliency map, and take the number of pixels with abnormality measure value greater than the response threshold (defined as highlight pixel points) divided by the total number of pixels in the preprocessed image as the defect area ratio ;
[0207] For all highlighted pixel points, the original abnormality metric value is accumulated and divided by the defect area (the number of highlighted pixel points) to obtain the average defect severity index ;
[0208] According to the quality standard set by the manufacturer, the seeds are graded, and in this embodiment, if no obvious defects or very small scratches are indicated (no obvious defects or very small scratches), the seeds are determined to be the preferred level;
[0209] If a small amount of defects but does not affect germination is indicated, the seeds are determined to be the qualified level;
[0210] If or severe damage or core mold is indicated, the seeds are determined to be the substandard level;
[0211] The system generates a digital control signal according to the determination result and sends it to the pneumatic sorting valve at the end of the pipeline, and in this embodiment, the signal is 00, which opens the preferred channel, and the preferred level seeds fall into the preferred bin;
[0212] The signal is 01, which opens the qualified channel and the qualified level seeds fall into the qualified bin;
[0213] The signal is 10, which starts the high-pressure air gun and blows the substandard level seeds into the substandard bin.
[0214] The present application establishes a mapping relationship from the image algorithm index to the industrial grading standard, not only considers the size area ratio of the defect, but also considers the depth degree severity index of the defect, i.e. the size of the reconstruction error, realizes the multi-dimensional comprehensive evaluation of the seed quality, can directly drive the hardware equipment such as pneumatic sorting valve, and realizes the automation closed loop of detection and sorting.
[0215] The application provides a seed quality intelligent detection system based on big data, which significantly improves the detection robustness of complex texture and irregular defect seeds compared with the prior art. The core advantage is that the tensor ring decomposition algorithm and the deep superpixel segmentation mechanism are introduced. By constructing a high-order feature tensor, the system can fully mine the high-order spatial structure and texture detail correlation between pixels in the seed appearance image. Using the low-rank approximation characteristics of tensor ring decomposition, the normal seed texture (low-rank component) and the randomly distributed mold, scratch and other defects (high-rank sparse component) are effectively separated. This unsupervised or semi-supervised anomaly detection logic based on reconstruction error greatly reduces the dependence on prior knowledge of specific defect morphology. Even in the face of tiny spots or no obvious directional clutter texture, the difference between the original tensor and the reconstructed tensor can be quantified to generate a high-precision appearance defect saliency map, thereby realizing accurate and automatic grading of seed quality. The application uses a deep learning network that integrates a multi-scale attention mechanism and homogeneity strong constraints at the image deconstruction level, solving the problems of poor edge fitting and semantic information loss of traditional superpixel algorithms when processing complex agricultural images. The design of the feature pyramid attention unit enables the network to extract local tiny spots, medium-scale textures and macro contour features in parallel. The channel attention weighting enhances the expression ability of effective features. Combined with the composite loss function containing spatial compactness and homogeneity constraints, the network is forced to generate superpixel blocks that can tightly fit the irregular defect boundaries while maintaining internal texture consistency. This coupled architecture of deep feature extraction and tensor low-rank analysis not only improves the adaptability of the detection system to multiple defect types, but also ensures efficient landing and accurate execution of the algorithm model on the actual agricultural production line through standardized tensor dimension mapping and industrial-level sorting instruction output.
[0216] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (or computer- readable storage media) having computer-usable program code embodied in the medium. The medium can be any available storage media that can be accessed by a computer. By way of example, and not limitation, such computer-usable storage media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other storage medium(s) that can be used to carry or store desired computer program code in the form of instructions or data structures and that can be accessed by a computer. Also, the present application can be embodied in a computer program product that can be traded as goods or merchandise, through the storage medium described above or any other suitable medium. Accordingly, the computer medium can be any entity or device containing, or Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks
[0217] It should be noted that the above-mentioned embodiments are only used to illustrate but not to limit the technical solutions of the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application, and they should be covered in the scope of the claims of the present application.
Claims
1. A big data-based intelligent seed quality detection system, characterized in that, The method comprises a collection module, a segmentation module, an estimation module and a management module. The collection module is configured to collect appearance image data of seeds and perform preprocessing. The segmentation module is configured to deconstruct the appearance image data of the preprocessed seeds into superpixel blocks by using a pre-trained deep convolutional neural network model based on a multi-scale attention mechanism and a homogeneity strong constraint. The estimation module is configured to extract high-dimensional features of the superpixel blocks and convert them into tensor representation, perform low-rank decomposition on the high-dimensional feature tensor based on a tensor ring decomposition algorithm, and generate an appearance defect saliency map by calculating the reconstruction error between the original feature tensor and the reconstructed tensor. The management module is configured to quantify a seed defect index according to the appearance defect saliency map and grade in combination with a preset quality standard. The deep convolutional neural network model comprises a feature encoder, a feature pyramid attention unit, a feature decoder and a region division prediction head. The feature encoder comprises a shallow convolutional layer and a deep convolutional layer, and the initialized image data is input into the shallow convolutional layer to obtain a shallow feature map, and the shallow feature map is input into the deep convolutional layer to generate a deep feature map. The initialized image data is obtained by performing an initialization operation on the preprocessed appearance image data, and the initialization operation comprises: dividing the preprocessed appearance image data into multiple rectangular grid units according to a preset superpixel sampling interval, and defining the geometric center coordinates of each rectangular grid unit as a potential superpixel center. The deep convolutional neural network is pre-trained by minimizing a composite loss function. The composite loss function comprises a homogeneity constraint term and a spatial compactness loss term. The mathematical expression of the composite loss function is: ; wherein, is a spatial compactness loss term, is a homogeneity constraint term, is a preset parameter, is a compound loss function; The homogeneity constraint term is the Euclidean distance between the pixel feature vector inside the superpixel region and the cluster center feature vector of the region. The mathematical expression of the homogeneity constraint term is: ; in, For homogeneity constraint terms, The global index representing the potential superpixel center, with a value ranging from 1 to A, where A is the total number of grid cells in the entire image. For pixels The set consisting of 9 potential superpixel centers around it. pixels inside the superpixel region eigenvectors, Denotes the square of the L2 norm. Let p be the probability that pixel p belongs to k. The feature vector of the cluster center; The mathematical expression of the cluster center feature vector is: ; wherein, for traversing each pixel point in the initialized appearance image data, a global index representing a latent superpixel center, taking a value of 1 to A, A being a total number of grids divided in the whole image, a pixel a probability belonging to v, a pixel a feature vector on the pixel-level feature mapping graph; The spatial compactness loss term is the Euclidean distance between the spatial coordinates of the pixel and the superpixel spatial center. The mathematical expression of the spatial compactness loss term is: ; wherein, is a spatial compactness loss, is a global index representing a potential superpixel center, taking values from 1 to A, A being the total number of grids partitioned in the whole image, is a pixel belongs to a probability, is an intrinsic spatial coordinate of a pixel , is a superpixel spatial center; The pre-trained deep convolutional neural network model is obtained by training the deep convolutional neural network model using a training set, verifying it using a validation set, iteratively updating the network parameters of the deep convolutional neural network model, and fixing the network parameters after training.
2. The big data based intelligent seed quality detection system as claimed in claim 1, wherein, The appearance image data is real-time collected appearance image data of the crop seeds to be detected. The preprocessing comprises uniform resolution adjustment and normalization processing of the appearance image data to obtain preprocessed appearance image data. The uniform resolution adjustment comprises collecting appearance RGB images of the seeds by an industrial camera and adjusting the resolution of all appearance RGB images to a standard input resolution size. The normalization processing is to standardize the image pixel values.
3. The big data based intelligent seed quality detection system as claimed in claim 2, wherein, The feature pyramid attention unit includes branch 1, branch 2 and branch 3 in parallel, and the processing logic of the branch 1, branch 2 and branch 3 includes: inputting the deep feature map into the branch 1, branch 2 and branch 3 respectively for convolution operation, obtaining local micro lesion feature, medium scale feature and macroscopic contour feature respectively, and splicing the local micro lesion feature, medium scale feature and macroscopic contour feature through the channel dimension to obtain a multi-scale feature tensor; The feature pyramid attention unit further includes a channel attention weighting layer, and the processing logic of the channel attention weighting layer includes: performing pooling, convolution and activation operations on the multi-scale feature tensor through the channel attention weighting layer to obtain a weight vector for each feature channel, and performing element-wise multiplication on the multi-scale feature tensor and the weight vector to output an enhanced feature map.
4. The big data based intelligent seed quality detection system as claimed in claim 3, wherein, The processing logic of the feature decoder includes: inputting the enhanced feature map into the feature decoder for bilinear interpolation upsampling, and performing element-wise addition on the upscaled enhanced feature map and the shallow feature map to obtain a pixel-level feature mapping. The processing logic of the region division prediction head includes: after the pixel-level feature mapping is subjected to convolution operation, a Softmax activation function is used to output a belonging probability matrix with 9 channels, and the elements of the belonging probability matrix represent the probability that each pixel in the preprocessed image data belongs to 9 potential superpixel centers in the surrounding 3x3 neighborhood.
5. The big data based intelligent seed quality detection system as claimed in claim 4, wherein, The estimation module includes a feature tensorization unit for constructing a high-order feature tensor; The process of constructing the high-order feature tensor includes: obtaining the belonging probability matrix through a pre-trained deep convolutional neural network, comparing the 9 probability values of each pixel in the belonging probability matrix, selecting the index of the channel with the largest probability value as the belonging number of the pixel, and generating a superpixel index map; All pixels belonging to the same belonging number are obtained from the superpixel index map, the feature vectors of the pixels belonging to the same belonging number are spliced to obtain a feature matrix; The statistical moments of the feature matrix are calculated, and the statistical moments are constructed into a statistical feature vector; The statistical moments include mean, variance, skewness and kurtosis; According to the tensor dimension mapping rule, the statistical feature vector is mapped into a high-order feature tensor; The tensor dimension mapping rule includes: The order and the dimension of each order of the high-order feature tensor are set, and the product of all the dimensions is the total capacity; The elements in the statistical feature vector are filled into the orders of the high-order feature tensor; If the length of the statistical feature vector is equal to the total capacity, the elements in the statistical feature vector are filled into the dimensions of each order in row priority order; If the length of the statistical feature vector is less than the total capacity, elements with a value of zero are filled at the end of the statistical feature vector until the length is equal to the total capacity, and then filled into the dimensions of each order in row priority order; If the length of the statistical feature vector is greater than the total capacity, the pre-set order and the dimension of each order of the high-order feature tensor are adjusted until the length of the statistical feature vector is less than or equal to the total capacity, and then the filling operation is performed.
6. The big data based intelligent seed quality detection system as claimed in claim 5, wherein, The estimation module further comprises a decomposition calculation unit configured to construct an objective function for minimizing reconstruction error, and decompose the high-order feature tensor into tensor ring core factors by using an alternating least squares method; An expression of the objective function is as follows: ; wherein denotes the Frobenius norm, denotes the trace of the chain product of core tensors, is the order of the higher-order characteristic tensor, is the higher-order characteristic tensor; The process of obtaining the core tensors comprises: A topology of the tensor ring is determined according to a preset rank vector, a plurality of core tensors to be solved are constructed in the topology, and numerical initialization is performed on the core tensors except the first core tensor by using a random distribution strategy; The objective function is updated by using the alternating least squares method in a loop until a preset convergence condition is met, and the tensor ring core factors are output.
7. The big data based intelligent seed quality detection system as claimed in claim 6, wherein, The estimation module generates an appearance defect saliency map by calculating reconstruction error; The reconstruction error calculation process comprises reconstructing an approximate tensor by using the tensor ring core factors, and calculating a Frobenius norm between the original high-order feature tensor and the approximate tensor; The generation process comprises assigning the Frobenius norm as an abnormality metric value to a pixel region covered by the corresponding superpixel block.
8. The big data based intelligent seed quality detection system as claimed in claim 7, wherein, The hierarchical strategy of the management module comprises a defect area proportion index and a defect severity index of a seed appearance defect saliency map; The defect area proportion index is obtained by calculating a proportion of defect pixels to total pixels after binarization segmentation of the appearance defect saliency map; The defect severity index is obtained by integrating reconstruction error values of defect pixels in the appearance defect saliency map and taking an average value; The management module outputs a sorting control instruction according to the area proportion index and the defect severity index.
Citation Information
Patent Citations
Tomato seed quality detection method based on spectrum technology
CN118982498A
SAR image segmentation method based on wavelet pooling convolutional neural networks
CN105139395A
Rapid object detection by combining structural information from image segmentation with bio-inspired attentional mechanisms
US9147255B1