Sesame quality detection method and system based on image recognition
By acquiring reflectance spectral data and microscopic imaging characteristics of sesame epidermis and endosperm, and combining them with dynamic exposure control, the impact of environmental changes on sesame quality detection was resolved, and high-precision sesame quality assessment was achieved.
Patent Information
- Application Number
- CN202511334356.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-02-10
AI Technical Summary
Existing sesame quality detection technologies suffer from unstable image acquisition quality due to fluctuations in ambient light intensity and changes in sesame stacking density, making it difficult to accurately distinguish minute defects and limiting detection accuracy.
By acquiring the reflectance spectral data of the waxy epidermis and internal endosperm of sesame seeds, and combining it with microscopic imaging to capture microcracks and mold spots, a texture feature matrix is set up to extract morphological, color, and texture features. Exposure time and LED light source intensity are dynamically calibrated, and adaptive exposure compensation control is implemented to optimize the classification boundary.
It effectively resists interference from fluctuations in ambient light intensity and changes in sesame stacking density, improving the accuracy and stability of sesame quality testing and ensuring accurate identification of minute defects.
Smart Images

Figure CN121504802A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition analysis, and particularly relates to a sesame quality detection method and system based on image recognition. BACKGROUND
[0002] With the standardization development of the food industry, sesame quality detection has become a key link of the quality control of the industrial chain. The conventional sesame quality detection technology has significant limitations. Specifically, the existing image recognition method focuses on a single feature, and it is difficult to fully depict the quality differences of complete grains, broken grains and abnormal color grains, resulting in insufficient detection dimension. In addition, due to the fluctuation of environmental light intensity and the change of sesame stacking density, the image acquisition quality is unstable, the distinguishing precision of subtle defects such as mold spots and micro-cracks is insufficient, and the quality control requirements of high-purity sesame processing cannot be met.
[0003] In summary, the prior art has the technical problems of unstable image acquisition quality caused by fluctuation of environmental light intensity and change of sesame stacking density, difficulty in accurately distinguishing subtle defects, and limited sesame quality detection precision. SUMMARY
[0004] The present application provides a sesame quality detection method and system based on image recognition, which aims to solve the technical problems of unstable image acquisition quality caused by fluctuation of environmental light intensity and change of sesame stacking density in the prior art, difficulty in accurately distinguishing subtle defects, and limited sesame quality detection precision.
[0005] In view of the above problems, the technical scheme of the present application is as follows:
[0006] In a first aspect, the present application provides a sesame quality detection method based on image recognition, wherein the method comprises: acquiring first reflection spectrum data of the sesame cuticle wax layer and second reflection spectrum data of the sesame endosperm inside, combining micro-imaging to capture seed surface micro-crack and mold spot characteristics, and setting a texture feature matrix; according to a single sesame grain, extracting the morphological features, color features and texture features of the sesame grain, wherein the texture features are associated with the gray level co-occurrence matrix entropy value; fine-tuning a pre-trained sesame classification model in a sesame variety database, performing multi-dimensional feature fusion of the sesame quality evaluation of complete grains, broken grains and abnormal color grains through the morphological features, color features and texture features of the sesame grain, configuring the model input layer parameters, and adjusting the model internal neuron weights; at the same time, dynamically calibrating the exposure time and the LED light source intensity, and triggering adaptive exposure compensation control when detecting fluctuation of environmental light intensity or change of sesame stacking density.
[0007] Preferably, the raw reflectance spectrum data uploaded to the spectrometer is denoised to determine the characteristic absorption peak corresponding to the characteristic waveband; at the same time, the ratio of the average reflectivity of the first reflectance spectrum data to the peak intensity of the second reflectance spectrum data is used as a quantitative index of the difference in the integrity of the wax layer on the surface of the sesame and the endosperm inside the sesame.
[0008] Preferably, based on the target sesame sample, a preset waveband range is set according to the characteristic waveband corresponding to the characteristic absorption peak; wherein the first segment of the preset waveband range is used to extract the first reflectance spectrum data of the wax layer on the surface of the sesame, and the second segment of the preset waveband range is used to extract the second reflectance spectrum data of the endosperm inside the sesame.
[0009] Preferably, the microscopic image is color channel separated, and the hue interval of the mold spot feature is identified through color space conversion; the microscopic image is subjected to multi-scale edge detection, and the length, width and distribution density under the microcracks on the surface of the grain are extracted through an edge detection operator, and the area proportion of the mold spot feature is combined as a matrix element to set a texture feature matrix.
[0010] Preferably, the adhered sesame particles are segmented to obtain the equivalent diameter, equivalent circularity and equivalent aspect ratio of a single particle, and identify the surface concave area of the particle; when the concave depth of the surface concave area of the particle exceeds a preset proportion threshold corresponding to the equivalent diameter, it is determined as a first type of broken feature; the first type of broken feature corresponding to the equivalent diameter of the single particle, the second type of broken feature corresponding to the equivalent circularity of the single particle, and the third type of broken feature corresponding to the equivalent aspect ratio of the single particle are configured as morphological feature quantization classification constraint conditions.
[0011] Preferably, based on the morphological feature quantization classification constraint conditions, the morphological features are quantized into an area feature vector, a perimeter feature vector and a convex hull area feature vector, and the texture feature matrix is feature spliced; an attention mechanism is used to assign weights to the fused features after feature splicing, high-order coupled features are extracted through a multi-layer perception, and the hidden layer of a pre-trained sesame classification model is input to optimize the broken classification boundary.
[0012] Preferably, the L lightness mean value, a chroma mean value and b chroma mean value of the sesame particles are extracted in the CIE Lab color space to determine the coefficient of variation of the color feature; based on the coefficient of variation of the color feature, a Gaussian mixture is constructed to cluster the color distribution, the Mahalanobis distance from each cluster center to the standard sesame color is obtained, the color feature is extracted through a local binary pattern, the two-dimensional feature space is formed by combining the coefficient of variation of the color feature, and the optimal classification hyperplane is learned using a support vector machine to optimize the heterochromatic classification boundary.
[0013] Preferably, the texture feature parameters are obtained using a gray level co-occurrence matrix, the image is subjected to multi-resolution decomposition through wavelet transform, and the energy features of the high-frequency subband are extracted; the texture local features are extracted by combining the energy features of the high-frequency subband with the LBP operator to generate an LBP histogram; and the texture feature correlation coefficients of the probability distribution of different texture modes and the gray level co-occurrence matrix entropy value are obtained based on the LBP histogram, so as to optimize the texture classification boundary.
[0014] Preferably, the texture classification boundary includes a microcrack classification boundary and a mold spot classification boundary; the microcrack contrast threshold and the mold spot hue interval are adaptively adjusted according to the texture feature baseline in the sesame variety database, and a feature exclusive matrix of the microcrack and the mold spot is constructed; and when the same region simultaneously satisfies the microcrack feature and the mold spot feature, the texture gradient direction is checked once, and the multi-focal point stacking of the microscopic image is checked twice.
[0015] In a second aspect, the application provides a sesame quality detection system based on image recognition, wherein the system comprises: a matrix setting module that obtains first reflection spectrum data of a sesame epidermal wax layer and second reflection spectrum data of a sesame internal endosperm, combines microscopic imaging to capture seed surface microcrack and mold spot features, and sets a texture feature matrix; a feature extraction module that extracts morphological features, color features, and texture features of a single sesame grain, wherein the texture features are associated with a gray level co-occurrence matrix entropy value; a feature fusion module that fine-tunes a pre-trained sesame classification model in a sesame variety database, performs multi-dimensional feature fusion on the sesame quality evaluation of complete grains, broken grains, and abnormal color grains by using the morphological features, color features, and texture features of the sesame grain, configures model input layer parameters, and adjusts model internal neuron weights; and a compensation control module that simultaneously dynamically calibrates exposure time and LED light source intensity, and triggers adaptive exposure compensation control when detecting environmental light intensity fluctuations or sesame stacking density changes.
[0016] In summary, the one or more technical solutions provided in the application achieve the technical effects of effectively resisting the interference of environmental light intensity fluctuations and sesame stacking density changes by synchronously obtaining reflection spectrum data of the epidermal wax layer and the internal endosperm, combining a microscopic texture feature matrix, dynamically calibrating exposure time and LED light source intensity, combining an attention mechanism to weight distribute morphological, color, and texture features, optimizing a classification boundary, and guaranteeing the precision of sesame quality detection. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 The application provides a flowchart of a sesame quality detection method based on image recognition.
[0018] Figure 2This application provides a schematic diagram of the structure of a sesame quality detection system based on image recognition.
[0019] Explanation of reference numerals in the attached diagram: Matrix setting module M100, Feature extraction module M200, Feature fusion module M300, Compensation control module M400. Detailed Implementation
[0020] Example 1: The present application will be described in detail below with reference to the accompanying drawings, as follows... Figure 1 As shown, this application provides a sesame quality detection method based on image recognition, wherein the method includes:
[0021] Step 1: Obtain the first reflectance spectrum data of the waxy layer of sesame seed epidermis and the second reflectance spectrum data of the endosperm inside the sesame seed. Combine this with microscopic imaging to capture the microcracks and mold spots on the surface of the seeds and set up a texture feature matrix. Step 2: Based on a single sesame seed, extract the morphological features, color features and texture features of the sesame seed. The texture features are associated with the entropy value of the gray-level co-occurrence matrix.
[0022] Specifically, reflectance spectral data refers to the distribution of light intensity reflected by an object under illumination of different wavelengths of light. For the waxy outer layer and internal endosperm of sesame seeds, their reflectance spectral data can reflect their physical and chemical properties, such as the integrity of the waxy outer layer and the health status of the endosperm. Microscopic imaging refers to imaging the surface of sesame seeds with a high-powered microscope, which can capture microscopic features such as microcracks and mold spots. Microcracks refer to the tiny cracks on the surface of sesame seeds, while mold spots are spots formed by the growth of mold.
[0023] The texture feature matrix is a matrix used to describe the texture features of an image. It typically contains information such as the length, width, and distribution density of the texture. In sesame quality detection, the texture feature matrix can be used to quantify the features of microcracks and mold spots. Morphological features refer to the shape features of sesame grains, such as equivalent diameter, equivalent roundness, and equivalent aspect ratio. These can be used to determine the integrity of sesame grains. Color features refer to the color attributes of sesame grains, usually described by parameters such as lightness (L) and chromaticity (a, b) in a color space (such as CIE Lab). Color features can be used to distinguish grains of different colors. The gray-level co-occurrence matrix is a matrix used to describe the texture features of an image. The entropy value of the gray-level co-occurrence matrix reflects the complexity of the texture. In sesame quality detection, the entropy value of the gray-level co-occurrence matrix can be used to quantify the texture features of the sesame grain surface.
[0024] Execution steps: First reflectance spectral data of the waxy outer layer of sesame seeds and second reflectance spectral data of the endosperm inside the sesame seeds are obtained by spectrometer. Spectral imaging technology can accurately reflect the physical and chemical properties of the sesame seed outer layer and interior. For example, the reflectance spectral data of the waxy outer layer can be used to determine the integrity of the outer layer, while the reflectance spectral data of the endosperm can reflect its health status. Microscopic imaging technology is used to capture the microcracks and mold spots on the surface of sesame seeds and quantify these features into a texture feature matrix. For example, the length, width, and distribution density of microcracks, as well as the area ratio of mold spots, are recorded to form a texture feature matrix.
[0025] For a single sesame seed grain, its morphological features, color features, and texture features are extracted. Morphological features include equivalent diameter, equivalent roundness, and equivalent aspect ratio, which are used to determine the integrity of the sesame seed grain. Color features are described by the L, a, and b parameters in the CIE Lab color space, which can be used to distinguish grains of different colors. Texture features are quantified by the gray-level co-occurrence matrix entropy value, which can reflect the complexity of the texture on the surface of the sesame seed grain.
[0026] By acquiring reflectance spectral data and microscopic texture features, the quality of sesame can be comprehensively evaluated from both macroscopic and microscopic levels. Specifically, reflectance spectral data can reflect the internal health status of sesame, while microscopic texture features can capture subtle defects such as microcracks and mold spots. By extracting morphological, color, and texture features and correlating these features with the entropy value of the gray-level co-occurrence matrix, the quality characteristics of sesame grains can be comprehensively characterized, providing comprehensive data support for subsequent sesame quality classification.
[0027] Step 3: Fine-tune the pre-trained sesame classification model in the sesame variety database. Through the morphological, color, and texture features of the sesame grains, multi-dimensional feature fusion is performed using sesame quality evaluation criteria that include whole grains, broken grains, and discolored grains. Configure the model input layer parameters and adjust the neuron weights within the model. Step 4: Simultaneously, dynamically calibrate the exposure time and LED light source intensity. When fluctuations in ambient light intensity or changes in sesame stacking density are detected, trigger adaptive exposure compensation control.
[0028] Specifically, a pre-trained sesame classification model refers to a classification model that has been trained with a large amount of sesame sample data and can perform preliminary classification of sesame. Pre-trained models usually have good generalization ability, but need to be fine-tuned for specific tasks. Fine-tuning refers to further training the model on the basis of the pre-trained model using data for specific tasks (such as a sesame variety database) to improve the model's performance on specific tasks.
[0029] Multidimensional feature fusion refers to integrating features from different dimensions, such as morphology, color, and texture, of sesame seeds to form a comprehensive feature vector, which is used to more comprehensively describe the quality of sesame seeds. Dynamic calibration automatically adjusts the exposure time and LED light source intensity based on real-time detected environmental changes (such as light intensity fluctuations and changes in sesame seed stacking density) to ensure the stability and consistency of image acquisition. Adaptive exposure compensation control automatically triggers the exposure compensation mechanism when ambient light intensity fluctuations or changes in sesame seed stacking density are detected, adjusting the exposure parameters of the image acquisition device to reduce the impact of environmental changes on image acquisition quality.
[0030] Execution steps: The pre-trained sesame classification model is fine-tuned in the sesame variety database. By utilizing a large amount of sample data in the sesame variety database, the input layer parameters and internal neuron weights of the model are adjusted to enable the model to better adapt to the sesame quality detection task. For example, through fine-tuning, the model can more accurately identify sesame grains of different quality grades, such as whole grains, broken grains, and discolored grains.
[0031] This paper integrates the morphological, color, and texture features of sesame seeds. Morphological features include equivalent diameter, equivalent roundness, and equivalent aspect ratio; color features are described using the L, a, and b parameters in the CIE Lab color space; and texture features are quantified using the entropy value of the gray-level co-occurrence matrix. By fusing these features to form a comprehensive feature vector, the quality of sesame seeds can be described more comprehensively. For example, multi-dimensional feature fusion can improve the model's accuracy in identifying subtle defects (such as microcracks and mold spots).
[0032] Meanwhile, to address the impact of ambient light intensity fluctuations and changes in sesame seed stacking density on image acquisition quality, the system dynamically calibrates exposure time and LED light source intensity. When fluctuations in ambient light intensity or changes in sesame seed stacking density are detected, the adaptive exposure compensation control mechanism is triggered, automatically adjusting the exposure parameters of the image acquisition device. For example, in low ambient light conditions, the exposure time is increased to ensure image clarity; when sesame seed stacking density is high, the LED light source intensity is adjusted to reduce the impact of shadows on image acquisition. Through these steps, dynamic calibration and adaptive exposure compensation control effectively resist interference from environmental changes, ensuring the stability and consistency of image acquisition, thereby improving the overall performance of sesame seed quality detection.
[0033] Furthermore, to obtain the first reflectance spectral data of the waxy layer of sesame and the second reflectance spectral data of the endosperm inside the sesame plant, the method of this application also includes:
[0034] The raw reflectance spectral data uploaded by the spectrometer is denoised to determine the characteristic bands corresponding to the characteristic absorption peaks. At the same time, the ratio of the average reflectance of the first reflectance spectral data to the peak intensity of the second reflectance spectral data is used as a quantitative indicator of the difference in structural integrity between the waxy layer of the sesame epidermis and the endosperm inside the sesame plant.
[0035] Specifically, denoising refers to removing noise from spectral data using signal processing techniques to improve the signal-to-noise ratio and accuracy. Common denoising methods include smoothing filtering and wavelet transform. Characteristic absorption peaks refer to bands in spectral data where reflectance decreases significantly, usually corresponding to the absorption characteristics of specific substances. In sesame quality testing, characteristic absorption peaks can reflect the chemical composition and structure of the sesame epidermal wax layer and internal endosperm. Characteristic bands refer to wavelength ranges related to the characteristics of specific substances. Analyzing data in these bands can yield specific information about the substance. Average reflectance refers to the average intensity of reflected light within a specific band range, used to describe the overall reflectance characteristics of spectral data. Peak intensity ratio refers to the ratio of reflected light intensities in two different bands, used to quantify the differences between the structures of different substances and to compare the reflectance characteristics of the sesame epidermal wax layer and internal endosperm.
[0036] Execution steps: Denoise the raw reflectance spectral data uploaded by the spectrometer. Further, remove noise from the data through techniques such as smoothing filtering or wavelet transform, thereby improving the signal-to-noise ratio and accuracy of the spectral data. For example, wavelet transform can effectively remove high-frequency noise while retaining important features in the spectral data.
[0037] By analyzing the denoised spectral data, the characteristic bands corresponding to the characteristic absorption peaks are determined. Characteristic absorption peaks usually correspond to the absorption characteristics of specific substances, such as the chemical composition and structure of the waxy layer of sesame and the internal endosperm. By identifying these characteristic absorption peaks, characteristic bands related to the waxy layer of sesame and the internal endosperm can be determined. Furthermore, the quality and reliability of the spectral data can be improved through denoising and characteristic band identification.
[0038] Meanwhile, the ratio of the average reflectance of the first reflectance spectral data to the peak intensity of the second reflectance spectral data is used as a quantitative indicator of the difference in structural integrity between the sesame epidermal wax layer and the internal endosperm. It should be noted that a damaged epidermal wax layer makes sesame more susceptible to the influence of the external environment, thus affecting its quality. The average reflectance reflects the overall reflective characteristics of the epidermal wax layer, while the peak intensity ratio is used to quantify the structural differences between the epidermal wax layer and the internal endosperm. For example, a significant decrease in the peak intensity ratio indicates that the sesame epidermal wax layer is damaged, while the internal endosperm structure is relatively intact. Furthermore, by quantifying the difference in structural integrity between the epidermal wax layer and the internal endosperm, the quality of sesame can be assessed more accurately.
[0039] Furthermore, the method of this application includes:
[0040] Based on the target sesame sample, a preset band range is set according to the characteristic bands corresponding to the characteristic absorption peaks; wherein, the first segment of the preset band range is used to extract the first reflectance spectral data of the waxy layer of the sesame epidermis, and the second segment of the preset band range is used to extract the second reflectance spectral data of the endosperm inside the sesame.
[0041] Specifically, the target sesame sample refers to the sesame sample used for detection and analysis. These samples are representative and can reflect the overall quality characteristics of sesame. The preset wavelength range refers to the wavelength range set in advance according to the characteristic wavelength corresponding to the characteristic absorption peak, which is used to extract specific spectral data. The preset wavelength range is usually divided into multiple segments, each segment corresponding to a different detection target. The first segment is the wavelength range used to extract the reflectance spectral data of the waxy layer of the sesame epidermis, and the second segment is the wavelength range used to extract the reflectance spectral data of the endosperm inside the sesame.
[0042] Execution steps: Based on the characteristic bands corresponding to the characteristic absorption peaks of the target sesame sample, set a preset band range. By analyzing the spectral data of the target sesame sample, determine the band range that can effectively reflect the characteristics of the sesame epidermal wax layer and the internal endosperm. Preferably, the characteristic absorption peaks of the sesame epidermal wax layer are mainly concentrated in the wavelength range of 1200nm-1300nm, while the characteristic absorption peaks of the internal endosperm are mainly concentrated in the wavelength range of 1400nm-1500nm.
[0043] The preset wavelength range is divided into two segments: the first segment is used to extract the first reflectance spectral data of the sesame epidermal wax layer, and the second segment is used to extract the second reflectance spectral data of the sesame endosperm. In this way, the spectral characteristics of the epidermal wax layer and the endosperm can be obtained separately, thus providing a more comprehensive assessment of sesame quality. In the above steps, by precisely setting the preset wavelength range, the spectral data of the sesame epidermal wax layer and the endosperm can be effectively extracted. Furthermore, by extracting the reflectance spectral data of the preset wavelength range and the epidermal wax layer and the endosperm separately, the integrity, health status, and quality grade of sesame can be more accurately assessed, improving the precision and reliability of the detection, and significantly enhancing the accuracy and reliability of sesame quality testing.
[0044] Furthermore, by combining microscopic imaging to capture the characteristics of microcracks and mold spots on the grain surface and setting a texture feature matrix, the method of this application includes:
[0045] Color channels are separated in the microscopic image, and the hue range of the mold spot features is identified by color space conversion; multi-scale edge detection is performed on the microscopic image, and the length, width and distribution density of microcracks on the grain surface are extracted by the edge detection operator. The area ratio of the mold spot features is used as matrix elements to set the texture feature matrix.
[0046] Specifically, microscopic images refer to high-resolution images taken with a microscope that can clearly show the microstructure of sesame seed surfaces, such as microcracks and mold spots; color channel separation involves converting an image from the common RGB color space to other color spaces (such as HSV or Lab) and separating different color channels to facilitate the extraction of specific color features; hue range refers to the parameter range used to describe the color range; multi-scale edge detection refers to extracting edge features in an image using edge detection operators of different scales (such as the Sobel operator or Canny operator), which can detect microcracks at different scales; and texture feature matrix is used to store the texture features of the image, such as the length, width, and distribution density of microcracks, as well as the area ratio of mold spots.
[0047] Execution steps: Separate color channels in the microscopic image, and identify the hue range of mold spot features by color space conversion (e.g., from RGB to HSV). For example, determining the hue range of mold spots in the HSV color space can effectively identify mold spot areas. Perform multi-scale edge detection on the microscopic image, and extract the length, width, and distribution density of microcracks on the surface of sesame seeds by edge detection operators. These features, together with the area ratio of mold spot features, are used as matrix elements to set the texture feature matrix.
[0048] By employing color channel separation and edge detection techniques, microcracks and mold spots on the surface of sesame seeds are precisely extracted, providing crucial texture information for sesame quality assessment. For instance, the length, width, and distribution density of microcracks reflect the integrity of sesame seeds, while the area ratio of mold spots reflects the degree of mold growth. Integrating these features into a texture feature matrix allows for a more comprehensive assessment of sesame quality. In these steps, color channel separation and multi-scale edge detection significantly improve the accuracy and reliability of sesame quality detection.
[0049] Furthermore, based on individual sesame seeds, the morphological characteristics of the sesame seeds are extracted. The method of this application includes:
[0050] The adhering sesame particles are segmented to obtain the equivalent diameter, equivalent roundness, and equivalent aspect ratio of each individual particle, and the concave areas on the particle surface are identified. When the depth of the concave area on the particle surface exceeds a preset ratio threshold corresponding to the equivalent diameter, it is determined to be a type of breakage feature. Based on the type of breakage feature corresponding to the equivalent diameter of the individual particle, the type of breakage feature corresponding to the equivalent roundness of the individual particle, and the type of breakage feature corresponding to the equivalent aspect ratio of the individual particle, morphological feature quantification and classification constraints are configured.
[0051] Specifically, "adherent sesame particles" refers to multiple sesame particles sticking together to form a large clump, requiring image segmentation technology to separate them into individual particles; "equivalent diameter" refers to the diameter of a circle with the same area as the sesame particle, used to quantify the size of the sesame particle; "equivalent roundness" refers to how close the shape of the sesame particle is to an ideal circle, usually calculated from the particle's perimeter and area; "equivalent aspect ratio" refers to the ratio of the sesame particle's major axis to its minor axis, used to describe the particle's shape characteristics; "particle surface depressions" refers to the depressions on the surface of the sesame particle, usually related to the particle's integrity; "depression depth" refers to the depth of the depression relative to the particle surface, used to assess the degree of particle breakage; "preset ratio threshold" refers to the standard used to determine whether the depressions on the sesame particle surface meet the breakage characteristics; "breakage characteristics" refers to the breakage exhibited by the sesame particle in terms of morphology, such as depressions and cracks on the particle surface; and "quantitative grading constraints" refers to the conditions used to quantify and grade the breakage characteristics, typically including parameters such as equivalent diameter, equivalent roundness, and equivalent aspect ratio.
[0052] Execution steps: Segment the adhered sesame particles, obtain the equivalent diameter, equivalent roundness, and equivalent aspect ratio of each individual particle, and identify the concave areas on the particle surface. Through image segmentation, the adhered sesame particles can be separated into individual particles, thus providing a basis for subsequent morphological feature extraction. For example, through image segmentation technology, the adhered sesame particles can be separated into individual particles, and their morphological features such as equivalent diameter, equivalent roundness, and equivalent aspect ratio can be obtained.
[0053] When the depth of the depression on the particle surface exceeds a preset proportional threshold corresponding to the equivalent diameter, it is determined to be a type I breakage feature. For example, if the preset proportional threshold is 10% of the equivalent diameter, the particle can be determined to have a type I breakage feature when the depression depth exceeds this threshold. By configuring morphological feature quantification and grading constraints based on the type I breakage feature corresponding to the equivalent diameter of a single particle, the type II breakage feature corresponding to the equivalent roundness, and the type III breakage feature corresponding to the equivalent aspect ratio, for example: particles with an equivalent diameter less than 2mm and a type I breakage feature are judged as low quality; particles with an equivalent roundness less than 0.8 and a type II breakage feature are judged as medium quality; and particles with an equivalent aspect ratio greater than 1.5 and a type III breakage feature are judged as high quality.
[0054] In the above steps, the integrity of sesame grains is accurately assessed through image segmentation and morphological feature extraction. The breakage characteristics of sesame grains are classified through quantitative grading constraints, thereby providing key morphological information for sesame quality assessment. The quantitative grading of breakage characteristics can improve the accuracy and reliability of sesame quality detection.
[0055] Furthermore, the method of this application includes:
[0056] Based on the morphological feature quantization and grading constraints, the morphological features are quantized into area feature vectors, perimeter feature vectors, and convex hull area feature vectors, which are then concatenated with the texture feature matrix. An attention mechanism is used to assign weights to the fused features after feature concatenation. High-order coupling features are extracted through a multilayer perceptron and input into the hidden layer of the pre-trained sesame classification model to optimize the fragmented classification boundary.
[0057] Specifically, the morphological feature quantification and grading constraint refers to the grading standard set according to the morphological features of sesame seeds, such as equivalent diameter, equivalent roundness, and equivalent aspect ratio, used to quantify and grade morphological features; the area feature vector refers to the vector formed by quantifying the area features of sesame seeds, used to describe the size of the seeds; the perimeter feature vector refers to the vector formed by quantifying the perimeter features of sesame seeds, used to describe the edge length of the seeds; and the convex hull area feature vector refers to the vector formed by quantifying the convex hull area of sesame seeds (i.e., the area of the smallest convex polygon containing the seeds), used to describe the shape features of the seeds.
[0058] Feature concatenation refers to combining feature vectors of different types (such as morphological feature vectors and texture feature vectors) into a feature vector, which is used to more comprehensively describe the features of sesame seeds; attention mechanism is used to assign weights to features, enabling the model to pay more attention to important features; higher-order coupling features refer to more complex features extracted by multilayer perceptron, which can capture the interrelationships between different features; fragmentation classification boundary refers to the classification boundary used to distinguish between fragmented and intact seeds, and optimization can improve classification accuracy.
[0059] Execution steps: Based on the morphological feature quantification and grading constraints, the morphological features of sesame seeds are quantified into area feature vectors, perimeter feature vectors, and convex hull area feature vectors. Furthermore, by calculating the area, perimeter, and convex hull area of each sesame seed, the corresponding feature vectors can be obtained. These feature vectors can describe the morphological features of sesame seeds from different perspectives, such as size, shape, and edge characteristics. These morphological feature vectors are then concatenated with the previously extracted texture feature matrix to form a comprehensive feature vector. By combining morphological and texture features, the quality characteristics of sesame seeds can be described more comprehensively.
[0060] An attention mechanism is used to assign weights to the fused features after feature concatenation. This mechanism enables the model to focus more on important features, thereby improving classification accuracy. High-order coupling features are extracted through a multilayer perceptron. These features can capture the relationships between different features, further improving the expressive power of the features. The extracted high-order coupling features are input into the hidden layer of the pre-trained sesame classification model to optimize the fragmented classification boundary. By adjusting the model's internal parameters, the model can more accurately distinguish between fragmented and intact particles.
[0061] In the above steps, morphological and textural features are effectively integrated through feature splicing and attention mechanisms, and more complex features are extracted through multilayer perceptrons to optimize the broken classification boundary. This allows for more accurate identification of broken particles, improving detection accuracy and thus enhancing the precision and reliability of sesame quality detection.
[0062] Furthermore, based on individual sesame seeds, the color characteristics of the sesame seeds are extracted. The method of this application includes:
[0063] In the CIE Lab color space, the mean L lightness, mean a chromaticity, and mean b chromaticity of sesame grains are extracted to determine the coefficient of variation of color features. Based on the coefficient of variation of the color features, a Gaussian mixture is constructed to cluster the color distribution, and the Mahalanobis distance from each cluster center to the standard sesame color is obtained. Color features are extracted through local binary mode, and a two-dimensional feature space is formed by combining the coefficient of variation of the color features. The optimal classification hyperplane is learned using support vector machine to optimize the heterogeneous color classification boundary.
[0064] Specifically, the CIE Lab color space is a color space model based on human visual perception, which can more accurately describe the lightness (L) and chromaticity (a, b) characteristics of colors. L represents lightness, a represents the change from green to red, and b represents the change from blue to yellow. The L lightness mean is the average lightness of sesame seeds in the CIE Lab color space, used to describe the overall brightness of the seeds. The a chromaticity mean is the average a chromaticity of sesame seeds in the CIE Lab color space, used to describe the redness or greenness of the seeds. The b chromaticity mean is the average b chromaticity of sesame seeds in the CIE Lab color space, used to describe the yellowness or blueness of the seeds.
[0065] The coefficient of variation (COP) describes the dispersion of data and is calculated as the ratio of the standard deviation to the mean. In color features, the COP reflects the uniformity of color distribution. Gaussian Mixture Models (GMMs), based on a Gaussian distribution probability model, are used for cluster analysis. GMMs can divide the color distribution into different cluster centers. Mahalanobis distance, which considers the covariance of data, measures the similarity between data points and distribution centers. In color features, Mahalanobis distance can be used to compare the differences between different color cluster centers and the standard sesame color. Local Binary Patterns (LBPs), a texture feature extraction method, extracts texture information by analyzing the local neighborhood of an image. In color features, LBPs can be used to extract texture features of the color distribution. A two-dimensional feature space, consisting of two feature dimensions, describes the feature distribution of the data. In this scheme, it is composed of the COP and LBP features. Support Vector Machines (SVMs) are used to find the optimal classification hyperplane to separate data of different categories. In this scheme, SVMs are used to optimize the heterogeneous color classification boundary.
[0066] Execution steps: Extract the mean L lightness, mean a chromaticity, and mean b chromaticity of sesame grains in the CIE Lab color space. These parameters can comprehensively describe the color characteristics of sesame grains. Calculate the coefficient of variation (COP) of these color characteristics. The COP reflects the uniformity of color distribution; for example, a lower COP indicates a more uniform color distribution, while a higher COP indicates greater color variation. Based on the COP of the color characteristics, construct a Gaussian mixture model (GMM) to perform cluster analysis on the color distribution. The GMM can divide the color distribution of sesame grains into different cluster centers, each representing a color pattern. Calculate the Mahalanobis distance from each cluster center to the standard sesame color. The Mahalanobis distance can be used to measure the similarity between different color patterns and the standard sesame color.
[0067] Furthermore, by extracting color features through Local Binary Patterns (LBP), the texture information of color distribution can be captured, thus providing a richer description of color features. The coefficient of variation of color features is combined with LBP features to form a two-dimensional feature space, which can more comprehensively describe the color features of sesame grains. The optimal classification hyperplane is learned using Support Vector Machines (SVM) to optimize the heterochromatic classification boundary. SVM can effectively distinguish heterochromatic grains from normal grains, improving the accuracy of sesame quality detection. Furthermore, through experiments, it is verified that using the heterochromatic classification boundary optimized by SVM improves the recognition accuracy of heterochromatic grains.
[0068] By extracting and analyzing color features, we can accurately identify discolored grains, significantly improving the accuracy and reliability of sesame quality detection, especially the accuracy of identifying discolored grains, thus providing key color information for sesame quality assessment. By constructing a Gaussian Mixture Model (GMM), calculating Mahalanobis distance, extracting LBP features, and using SVM to optimize classification boundaries, we can provide more accurate data support for sesame quality detection.
[0069] Furthermore, based on individual sesame seeds, the texture features of the sesame seeds are extracted. The method of this application includes:
[0070] Texture feature parameters are obtained using the gray-level co-occurrence matrix. The image is then decomposed into multiple resolutions using wavelet transform to extract the energy features of the high-frequency sub-bands. Based on the energy features of the high-frequency sub-bands, local texture features are extracted using the LBP operator to generate an LBP histogram. Based on the LBP histogram, the correlation coefficient between the probability distribution of different texture modes and the entropy value of the gray-level co-occurrence matrix is obtained to optimize the texture classification boundary.
[0071] Specifically, the gray-level co-occurrence matrix (GLCM) is a matrix used to describe the texture features of an image. It reflects texture characteristics by statistically analyzing the co-occurrence relationships of pixel gray-level values at a certain distance and direction in the image. Texture feature parameters refer to statistical quantities extracted from the GLCM to describe texture characteristics, such as energy, entropy, and contrast. Wavelet transform decomposes the image at different scales to extract high-frequency and low-frequency information. High-frequency subband energy features refer to the energy information in the high-frequency subband after wavelet transform, reflecting the details and texture features of the image. The LBP operator (Local Binary Pattern) is an operator used to extract local texture features by comparing the gray-level values of the center pixel with those of its neighboring pixels to generate binary codes. The LBP histogram is a histogram obtained by statistically analyzing the LBP values of each pixel in the image, used to describe the texture distribution of the image. The texture feature correlation coefficient is a statistical quantity used to measure the correlation between different texture features and is used to optimize the texture classification boundary.
[0072] Execution steps: First, obtain texture feature parameters using the Gray-Level Co-occurrence Matrix (GLCM). The GLCM reflects texture characteristics by statistically analyzing the co-occurrence relationships of pixel gray values at a certain distance and direction in the image. Second, extract multiple texture feature parameters from the GLCM, such as energy (reflecting texture uniformity and roughness), entropy (reflecting texture complexity and randomness), and contrast (reflecting texture clarity and groove depth). Third, perform multi-resolution decomposition on the image using wavelet transform to extract the energy features of the high-frequency subband. Wavelet transform can decompose the image into high-frequency and low-frequency information at different scales. The energy features of the high-frequency subband reflect the details and texture features of the image, further enhancing the descriptive power of texture features.
[0073] By combining the energy characteristics of high-frequency subbands, the LBP operator is used to extract local texture features and generate LBP histograms. The LBP operator generates binary codes by comparing the gray values of the center pixel with those of its neighboring pixels, thereby extracting local texture features. The LBP histogram can effectively describe the texture distribution of an image and has a certain robustness to changes in illumination. Based on the LBP histogram, the correlation coefficient between the probability distribution of different texture modes and the entropy of the gray-level co-occurrence matrix is obtained to optimize the texture classification boundary. By evaluating the probability distribution of different texture modes and the correlation coefficient of texture features, texture features such as microcracks and mold spots can be distinguished more accurately, thereby optimizing the texture classification boundary.
[0074] In the above steps, the accuracy and reliability of identifying surface defects in sesame particles are significantly improved by extracting texture features at multiple scales and using multiple methods. The gray-level co-occurrence matrix and wavelet transform can extract texture features from both global and local levels, while the LBP operator and texture feature correlation coefficient further enhance the descriptive ability and classification accuracy of the features, providing more accurate data support for sesame quality detection.
[0075] Furthermore, the method of this application includes:
[0076] The texture classification boundaries include microcrack classification boundaries and mold spot classification boundaries. Based on the texture feature baseline in the sesame variety database, the contrast threshold of microcracks and the color range of mold spots are adaptively adjusted to construct a feature mutual exclusion matrix for microcracks and mold spots. Based on the feature mutual exclusion matrix for microcracks and mold spots, when the same region simultaneously satisfies the features of microcracks and mold spots, a first verification of texture gradient direction and a second verification of multi-focus stacking of microscopic images are performed.
[0077] Specifically, the texture classification boundary refers to the classification boundary used to distinguish different texture features (such as microcracks and mold spots), and is used to accurately identify and classify defects on the surface of sesame seeds; the microcrack classification boundary is used to distinguish the microcrack features on the surface of sesame seeds; the mold spot classification boundary is used to distinguish the mold spot features on the surface of sesame seeds; the texture feature baseline refers to the standard or reference values of texture features stored in the sesame variety database, and is used to compare and adjust the texture features of the current test sample; the contrast threshold is the threshold for distinguishing the brightness or color contrast of microcrack features, and areas exceeding this threshold are considered microcracks.
[0078] Tone ranges are used to distinguish the color range of mold spot features, and are usually defined in a specific color space (such as HSV or Lab); feature mutual exclusion matrix is used to store the mutual exclusion relationship between microcrack and mold spot features, that is, the same area cannot be identified as microcrack and mold spot at the same time; texture gradient direction verification refers to verifying the authenticity of features by analyzing the gradient direction of the texture; multifocal stacking of microscopic images is to improve the resolution and clarity of the image by stacking microscopic images with different focal points, thereby more accurately identifying features.
[0079] Execution steps: Define texture classification boundaries, including microcrack classification boundaries and mold classification boundaries, to accurately distinguish microcrack and mold features on the surface of sesame particles; based on the texture feature baseline in the sesame variety database, adaptively adjust the contrast threshold of microcracks and the hue range of mold spots; by analyzing the standard texture features in the database, dynamically adjust the contrast threshold and hue range of the current detection sample to adapt to sesame samples under different varieties and environmental conditions, thereby improving detection sensitivity.
[0080] A feature mutual exclusion matrix for microcracks and mold spots is constructed to store the mutual exclusion relationship between the features of microcracks and mold spots. That is, the same area cannot be identified as both microcracks and mold spots at the same time. For example, if a certain area meets the feature conditions of both microcracks and mold spots, further verification is required. Based on the feature mutual exclusion matrix, when the same area meets the features of both microcracks and mold spots, texture gradient direction verification (first verification) and multi-focus stacking of microscopic images (second verification) are performed. Texture gradient direction verification verifies the authenticity of the features by analyzing the gradient direction of the texture. Multi-focus stacking of microscopic images improves the resolution and clarity of the image by stacking microscopic images with different focal points, thereby more accurately identifying features. For example, multi-focus stacking clearly shows the depth of microcracks and the boundary of mold spots, thus avoiding misjudgment.
[0081] In the above steps, based on the feature mutual exclusion matrix, the texture feature parameters are adaptively adjusted and a multi-level verification mechanism is used to effectively reduce misjudgments, significantly improve the accuracy and reliability of surface defect identification of sesame particles, and ensure the precision of sesame quality detection.
[0082] In summary, the beneficial effects of the embodiments of this application are:
[0083] This application utilizes the first reflectance spectrum data of the waxy layer of sesame seed epidermis and the second reflectance spectrum data of the endosperm inside the sesame seed, combined with microscopic imaging to capture the characteristics of microcracks and mold spots on the seed surface, and sets up a texture feature matrix. Based on individual sesame seeds, morphological, color, and texture features are extracted, and the texture features are correlated with the entropy value of the gray-level co-occurrence matrix. A pre-trained sesame classification model is fine-tuned on a sesame variety database. Through morphological, color, and texture features of sesame seeds, multi-dimensional feature fusion is performed using sesame quality evaluation criteria that include whole seeds, broken seeds, and discolored seeds. The model input layer parameters are configured, and the weights of neurons within the model are adjusted. Simultaneously, exposure time and LED light source intensity are dynamically calibrated, and adaptive exposure compensation control is triggered when fluctuations in ambient light intensity or changes in sesame seed stacking density are detected. This application provides a sesame quality detection method and system based on image recognition. This technology achieves the following results: by simultaneously acquiring the reflectance spectral data of the epidermal wax layer and the internal endosperm, combining it with the microscopic texture feature matrix, dynamically calibrating the exposure time and LED light source intensity, effectively resisting the interference of ambient light intensity fluctuations and changes in sesame stacking density, and combining the attention mechanism to weight the morphological, color, and texture features, optimizing the classification boundary, and ensuring the accuracy of sesame quality detection.
[0084] Example 2, based on the same inventive concept as the image recognition-based sesame quality detection method in the previous examples, such as... Figure 2 As shown in the embodiment of this application, a sesame quality detection system based on image recognition is provided, wherein the system includes:
[0085] Matrix setting module M100: Acquires the first reflectance spectrum data of the waxy layer of sesame seed epidermis and the second reflectance spectrum data of the endosperm inside the sesame seed, and combines it with microscopic imaging to capture the microcracks and mold spots on the surface of the seeds, and sets the texture feature matrix.
[0086] Feature extraction module M200: Based on a single sesame seed, extract the morphological features, color features, and texture features of the sesame seed, and the texture features are associated with the entropy value of the gray-level co-occurrence matrix.
[0087] Feature fusion module M300: Fine-tunes the pre-trained sesame classification model in the sesame variety database. It performs multi-dimensional feature fusion based on the morphological, color, and texture features of the sesame grains, using sesame quality evaluation criteria that include whole grains, broken grains, and grains with different colors. It also configures the model input layer parameters and adjusts the weights of neurons within the model.
[0088] M400 Compensation Control Module: Simultaneously, it dynamically calibrates the exposure time and LED light source intensity. When it detects fluctuations in ambient light intensity or changes in sesame seed stacking density, it triggers adaptive exposure compensation control.
[0089] Furthermore, the matrix setting module M100 is also used to perform the following method:
[0090] The raw reflectance spectral data uploaded by the spectrometer is denoised to determine the characteristic bands corresponding to the characteristic absorption peaks. At the same time, the ratio of the average reflectance of the first reflectance spectral data to the peak intensity of the second reflectance spectral data is used as a quantitative indicator of the difference in structural integrity between the waxy layer of the sesame epidermis and the endosperm inside the sesame plant.
[0091] Furthermore, the matrix setting module M100 is also used to perform the following method:
[0092] Based on the target sesame sample, a preset band range is set according to the characteristic bands corresponding to the characteristic absorption peaks; wherein, the first segment of the preset band range is used to extract the first reflectance spectral data of the waxy layer of the sesame epidermis, and the second segment of the preset band range is used to extract the second reflectance spectral data of the endosperm inside the sesame.
[0093] Furthermore, the matrix setting module M100 is also used to perform the following method:
[0094] Color channels are separated in the microscopic image, and the hue range of the mold spot features is identified by color space conversion; multi-scale edge detection is performed on the microscopic image, and the length, width and distribution density of microcracks on the grain surface are extracted by the edge detection operator. The area ratio of the mold spot features is used as matrix elements to set the texture feature matrix.
[0095] Furthermore, the feature extraction module M200 is used to perform the following method:
[0096] The adhering sesame particles are segmented to obtain the equivalent diameter, equivalent roundness, and equivalent aspect ratio of each individual particle, and the concave areas on the particle surface are identified. When the depth of the concave area on the particle surface exceeds a preset ratio threshold corresponding to the equivalent diameter, it is determined to be a type of breakage feature. Based on the type of breakage feature corresponding to the equivalent diameter of the individual particle, the type of breakage feature corresponding to the equivalent roundness of the individual particle, and the type of breakage feature corresponding to the equivalent aspect ratio of the individual particle, morphological feature quantification and classification constraints are configured.
[0097] Furthermore, the feature extraction module M200 is also used to perform the following method:
[0098] Based on the morphological feature quantization and grading constraints, the morphological features are quantized into area feature vectors, perimeter feature vectors, and convex hull area feature vectors, which are then concatenated with the texture feature matrix. An attention mechanism is used to assign weights to the fused features after feature concatenation. High-order coupling features are extracted through a multilayer perceptron and input into the hidden layer of the pre-trained sesame classification model to optimize the fragmented classification boundary.
[0099] Furthermore, the feature extraction module M200 is also used to perform the following method:
[0100] In the CIE Lab color space, the mean L lightness, mean a chromaticity, and mean b chromaticity of sesame grains are extracted to determine the coefficient of variation of color features. Based on the coefficient of variation of the color features, a Gaussian mixture is constructed to cluster the color distribution, and the Mahalanobis distance from each cluster center to the standard sesame color is obtained. Color features are extracted through local binary mode, and a two-dimensional feature space is formed by combining the coefficient of variation of the color features. The optimal classification hyperplane is learned using support vector machine to optimize the heterogeneous color classification boundary.
[0101] Furthermore, the feature extraction module M200 is also used to perform the following method:
[0102] Texture feature parameters are obtained using the gray-level co-occurrence matrix. The image is then decomposed into multiple resolutions using wavelet transform to extract the energy features of the high-frequency sub-bands. Based on the energy features of the high-frequency sub-bands, local texture features are extracted using the LBP operator to generate an LBP histogram. Based on the LBP histogram, the correlation coefficient between the probability distribution of different texture modes and the entropy value of the gray-level co-occurrence matrix is obtained to optimize the texture classification boundary.
[0103] Furthermore, the feature extraction module M200 is also used to perform the following method:
[0104] The texture classification boundaries include microcrack classification boundaries and mold spot classification boundaries. Based on the texture feature baseline in the sesame variety database, the contrast threshold of microcracks and the color range of mold spots are adaptively adjusted to construct a feature mutual exclusion matrix for microcracks and mold spots. Based on the feature mutual exclusion matrix for microcracks and mold spots, when the same region simultaneously satisfies the features of microcracks and mold spots, a first verification of texture gradient direction and a second verification of multi-focus stacking of microscopic images are performed.
[0105] In summary, any step can be stored as a computer instruction or program in an unrestricted computer memory and can be called and recognized by an unrestricted computer processor; no further restrictions are imposed here.
[0106] Furthermore, the above technical solutions only embody the preferred technical solutions of the embodiments of this application. Any changes that those skilled in the art may make to certain parts of these solutions embody the novel principles of the embodiments of this application. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application.
Claims
1. A sesame quality detection method based on image recognition, characterized in that, The method includes: Acquire the first reflectance spectral data of the waxy layer of sesame epidermis and the second reflectance spectral data of the endosperm inside sesame, and combine microscopic imaging to capture the microcracks and mold spots on the surface of the seeds, and set up a texture feature matrix; Based on a single sesame seed, the morphological features, color features, and texture features of the sesame seed are extracted, and the texture features are associated with the entropy value of the gray-level co-occurrence matrix. The pre-trained sesame classification model was fine-tuned in the sesame variety database. Multi-dimensional feature fusion was performed using the morphological, color, and texture features of the sesame grains, with sesame quality evaluation criteria including whole grains, broken grains, and discolored grains. The model input layer parameters were configured, and the weights of neurons inside the model were adjusted. Meanwhile, the exposure time and LED light source intensity are dynamically calibrated, and adaptive exposure compensation control is triggered when fluctuations in ambient light intensity or changes in sesame seed stacking density are detected.
2. The sesame quality detection method based on image recognition as described in claim 1, characterized in that, The method for obtaining the first reflectance spectral data of the waxy layer of sesame seed epidermis and the second reflectance spectral data of the endosperm inside sesame seed also includes: The raw reflectance spectral data uploaded by the spectrometer is denoised to determine the characteristic bands corresponding to the characteristic absorption peaks; Meanwhile, the ratio of the average reflectance of the first reflectance spectral data to the peak intensity of the second reflectance spectral data is used as a quantitative indicator of the difference in structural integrity between the waxy layer of the sesame epidermis and the endosperm inside the sesame plant.
3. The sesame quality detection method based on image recognition as described in claim 2, characterized in that, The method includes: Based on the target sesame sample, a preset band range is set according to the characteristic bands corresponding to the characteristic absorption peaks; The first segment of the preset wavelength range is used to extract the first reflectance spectral data of the waxy layer of the sesame epidermis, and the second segment of the preset wavelength range is used to extract the second reflectance spectral data of the endosperm inside the sesame plant.
4. The sesame quality detection method based on image recognition as described in claim 1, characterized in that, The method combines microscopic imaging to capture the characteristics of microcracks and mold spots on the surface of grains, and sets up a texture feature matrix. Color channels are separated from the microscopic image, and the tonal range of the mold spot features is identified by color space conversion; Multi-scale edge detection is performed on the microscopic image. The length, width and distribution density of microcracks on the surface of the grain are extracted by the edge detection operator. The area ratio of the mold spot features is used as matrix elements to set the texture feature matrix.
5. The sesame quality detection method based on image recognition as described in claim 4, characterized in that, Based on individual sesame seeds, the morphological characteristics of the seeds are extracted, and the method includes: The adhering sesame particles are segmented to obtain the equivalent diameter, equivalent roundness, and equivalent aspect ratio of each individual particle, and the concave areas on the particle surface are identified. When the depression depth of the depression region on the particle surface exceeds the preset proportional threshold corresponding to the equivalent diameter, it is determined to be a type of breakage feature; By configuring morphological feature quantification and classification constraints based on the first type of breakage feature corresponding to the equivalent diameter of the single particle, the second type of breakage feature corresponding to the equivalent roundness of the single particle, and the third type of breakage feature corresponding to the equivalent aspect ratio of the single particle.
6. The sesame quality detection method based on image recognition as described in claim 5, characterized in that, The method includes: Based on the morphological feature quantization and grading constraints, the morphological features are quantized into area feature vectors, perimeter feature vectors, and convex hull area feature vectors, which are then concatenated with the texture feature matrix. An attention mechanism is used to assign weights to the fused features after feature concatenation. High-order coupled features are extracted through a multilayer perceptron and input into the hidden layer of a pre-trained sesame classification model to optimize the fragmented classification boundary.
7. The sesame quality detection method based on image recognition as described in claim 5, characterized in that, The method for extracting the color features of individual sesame seeds includes: The mean L value of lightness, mean a value of chromaticity, and mean b value of sesame particles were extracted in the CIE Lab color space to determine the coefficient of variation of color features. Based on the coefficient of variation of the color features, a Gaussian mixture is constructed to cluster the color distribution, and the Mahalanobis distance from each cluster center to the standard sesame color is obtained. Color features are extracted through local binary mode, and a two-dimensional feature space is formed by combining the coefficient of variation of the color features. The optimal classification hyperplane is learned by using support vector machine, and the heterochromatic classification boundary is optimized.
8. The sesame quality detection method based on image recognition as described in claim 5, characterized in that, The method for extracting texture features of individual sesame seeds includes: Texture feature parameters are obtained using the gray-level co-occurrence matrix, and the image is decomposed into multiple resolutions using wavelet transform to extract the energy features of the high-frequency subband. LBP histogram is generated by extracting local texture features using the energy characteristics of the high-frequency subband and combining them with the LBP operator. Based on the LBP histogram, the correlation coefficient between the probability distribution of different texture modes and the entropy of the gray-level co-occurrence matrix is obtained to optimize the texture classification boundary.
9. The sesame quality detection method based on image recognition as described in claim 8, characterized in that, The texture classification boundaries include microcrack classification boundaries and mold spot classification boundaries; Based on the texture feature baseline in the sesame variety database, the contrast threshold of microcracks and the color range of mold spots are adaptively adjusted to construct a feature mutual exclusion matrix between microcracks and mold spots. Based on the mutual exclusion matrix of the features of microcracks and mold spots, when the same region simultaneously satisfies the features of microcracks and mold spots, a first verification of texture gradient direction and a second verification of multi-focus stacking of microscopic images are performed.
10. A sesame quality detection system based on image recognition, characterized in that, The system is used to implement the image recognition-based sesame quality detection method according to any one of claims 1-9, wherein the system comprises: Matrix setting module: Acquire the first reflectance spectrum data of the waxy layer of sesame seed epidermis and the second reflectance spectrum data of the endosperm inside sesame seed, combine microscopic imaging to capture the microcracks and mold spots on the surface of the seeds, and set the texture feature matrix; Feature extraction module: Based on a single sesame seed, extract the morphological features, color features, and texture features of the sesame seed, and the texture features are associated with the entropy value of the gray-level co-occurrence matrix; Feature fusion module: Fine-tunes the pre-trained sesame classification model in the sesame variety database. Through the morphological, color and texture features of the sesame grains, multi-dimensional feature fusion is performed using sesame quality evaluation criteria that include whole grains, broken grains and discolored grains. The model input layer parameters are configured, and the weights of neurons inside the model are adjusted. Compensation control module: Simultaneously, it dynamically calibrates exposure time and LED light source intensity. When it detects fluctuations in ambient light intensity or changes in sesame seed stacking density, it triggers adaptive exposure compensation control.