Lycium barbarum screening method and system based on image analysis

By extracting multi-dimensional image data of wolfberry and building a data prediction model, the problem of inaccurate identification of wolfberry appearance differences in the existing technology is solved, and efficient and precise automation of wolfberry screening is achieved, reducing the negative impact of misjudgment on the enterprise.

CN120219684APending Publication Date: 2025-06-27NINGXIA INST OF AGRI PROD QUALITY STANDARDS & TESTING TECH (NINGXIA AGRI PROD QUALITY MONITORING CENT)
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510303154.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

It is difficult to accurately identify the appearance differences of wolfberry in the existing technology, resulting in high-quality wolfberry being misjudged as inferior or inferior wolfberry being mistakenly considered qualified, affecting the company's income and brand reputation.

Method used

By selecting diverse wolfberry samples, obtaining multi-dimensional image data, and extracting surface texture roughness and color distribution uniformity features in combination with grayscale symbiosis matrix and HSV color space, constructing a data prediction model, and evaluating and dynamically optimizing the recognition accuracy of image analysis algorithms.

Benefits of technology

It significantly improves the automation and accuracy of wolfberry screening, reduces the waste of high-quality wolfberry, improves screening efficiency, and reduces the negative impact of misjudgment on the company through scientific and quantifiable evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219684A_ABST
    Figure CN120219684A_ABST
Patent Text Reader

Abstract

The invention discloses a wolfberry screening method and system based on image analysis, and particularly relates to the technical field of wolfberry screening. Lycium barbarum samples with different growth environments, maturity, varieties and drying degrees are selected, images are shot under various illumination conditions, and data diversity is ensured; the image is preprocessed, surface texture roughness features and color distribution uniformity features are extracted, and support is provided for accurate classification; constructing a data prediction model based on the extracted features, evaluating the accuracy of the algorithm for identifying the appearance difference of the Chinese wolfberry fruits, and if the algorithm is high in accuracy, directly applying to a production line to realize automatic sorting of qualified and unqualified Chinese wolfberry fruits; and if the accuracy is low, the problem of misjudgment caused by natural differences of the Chinese wolfberry fruits is effectively solved by predicting the abnormal degree of the accuracy, dynamically adjusting the identification strategy and improving the screening precision, the accuracy and the automation level of Chinese wolfberry fruit screening are improved, the waste of high-quality Chinese wolfberry fruits is reduced, and the enterprise income and the brand reputation are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wolfberry screening, and particularly relates to a wolfberry screening method and system based on image analysis. Background Art

[0002] Wolfberry screening based on image analysis refers to the process of using image processing technology to automatically screen and classify wolfberries. Through high-resolution image acquisition devices (such as cameras), the system can accurately analyze the appearance characteristics of wolfberries (such as size, shape, color, surface defects, etc.). Based on these image data, image analysis algorithms can automatically identify and determine whether wolfberries meet the quality standards, and then realize the screening and sorting operations. This method not only improves the screening efficiency, but also reduces the errors of manual operations, ensuring the accuracy and consistency of the screening process.

[0003] The existing technologies have the following deficiencies:

[0004] Although the appearance of wolfberries has certain regularities, their shapes and colors may have natural differences. Wolfberries may have great differences in size, shape, color, etc. due to different growth environments, maturity levels, varieties, etc. Even for wolfberries of the same batch, their surfaces may show different appearance characteristics due to factors such as drying degree, insect pests or mildew. This natural diversity increases the difficulty of the image analysis system, making it possible that image analysis algorithms cannot accurately judge some subtle differences, resulting in high-quality wolfberries being misjudged as inferior, or inferior wolfberries being misjudged as qualified. In addition, high-quality wolfberries may be misclassified as inferior due to their appearance characteristics (such as uneven color, inconsistent size, etc.) not matching the standard samples in the training data. This will lead to the waste of high-quality wolfberries or their inability to enter the market, thus affecting the enterprise's revenue and brand reputation. Summary of the Invention

[0005] The purpose of the present invention is to provide a wolfberry screening method and system based on image analysis to solve the deficiencies in the background art.

[0006] To achieve the above purpose, the present invention provides the following technical solution: A wolfberry screening method based on image analysis, including the following steps:

[0007] S1: Select wolfberry samples with different growth environments, maturity levels, varieties, and drying degrees, and take pictures with a high-resolution camera under multiple lighting conditions to obtain a number of images of different wolfberry samples;

[0008] S2: Preprocess the obtained images, and use the gray-level co-occurrence matrix to extract the surface texture roughness features of the preprocessed images, and extract the color distribution uniformity features of the images by converting the images into the HSV color space;

[0009] S3: Based on the surface texture roughness features and color distribution uniformity features of the extracted images, construct a data prediction model, and determine the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries according to the output results of the model;

[0010] S4: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high, apply the image analysis algorithm to the actual production line, and according to the image analysis results, sort the qualified and unqualified wolfberries;

[0011] S5: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the abnormal degree of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction results to improve the accuracy of wolfberry screening.

[0012] Preferably, in S2, after analyzing the extracted surface texture roughness features of the image, generate an image surface texture roughness index, and the acquisition method of the image surface texture roughness index is as follows:

[0013] Obtain a binary image, convert the image into a black-and-white image, estimate the fractal dimension using the box-counting method, cover the image with boxes of different sizes, count the number of pixel points covered by the boxes, and calculate the relationship between the coverage number and the box size under different box sizes;

[0014] Select a series of boxes of different sizes, and set the size of each box to ∈. These boxes will be used to cover the image. For each box size ∈, calculate how many boxes are needed to cover all non-zero pixels in the image. Denote the box size as ∈, and calculate the number of pixels covered by each box as N(∈); perform a logarithmic transformation on the relationship between N(∈) and the box size ∈, and the expression is: ln(N(∈)) = Dln(1 / ∈); where D is the fractal dimension of the image, N(∈) is the number of covered boxes, and ∈ is the side length of the box;

[0015] Draw a relationship graph of ln(N(∈)) and ln(1 / ∈), and calculate its slope. The slope is the fractal dimension D of the image. Through the fitting of the logarithmic image of the image, obtain the fractal dimension D, and the expression is: Calculate the image surface texture roughness index, and the expression is: EP = D - 2; where EP is the image surface texture roughness index.

[0016] Preferably, in S2, after analyzing the extracted color distribution uniformity features of the image, generate an image color distribution uniformity index, and the acquisition method of the image color distribution uniformity index is as follows:

[0017] Convert the image from the RGB color space to the HSV color space. For the converted HSV image, extract the pixel values of the hue channel, calculate its histogram, and divide the hue range into several intervals; count the number of pixels in each interval to obtain the hue histogram. Each pixel in the image corresponds to a hue value, and count the number of pixels in each hue interval; calculate the entropy value of the hue histogram: where H is the hue entropy of the image, N is the number of intervals of the hue histogram, and p i is the pixel proportion of the i-th hue interval, and the calculation method is: where n i is the number of pixels in the i-th interval, and the denominator is the total number of all pixels. Calculate the image color distribution uniformity index, and the expression is: DF = H / log(N); DF is the image color distribution uniformity index.

[0018] Preferably, in S3, determine the accuracy of the image analysis algorithm in identifying the appearance differences of goji berries, specifically:

[0019] Normalize the image surface texture roughness index and the image color distribution uniformity index, and calculate the accuracy value of the image analysis algorithm in identifying the appearance differences of goji berries through the normalized image surface texture roughness index and the image color distribution uniformity index.

[0020] Preferably, compare the obtained accuracy value of the image analysis algorithm in identifying the appearance differences of goji berries with the reference threshold of the accuracy value of the image analysis algorithm in identifying the appearance differences of goji berries set according to historical data. If the accuracy value of the image analysis algorithm in identifying the appearance differences of goji berries is greater than or equal to the preset reference threshold of the accuracy value, it indicates that the accuracy of the image analysis algorithm in identifying the appearance differences of goji berries is high. At this time, no warning signal is generated, and the result of the image analysis algorithm in identifying the appearance differences of goji berries is classified as an accurate recognition result; if the accuracy value of the image analysis algorithm in identifying the appearance differences of goji berries is less than the preset reference threshold of the accuracy value, it indicates that the accuracy of the image analysis algorithm in identifying the appearance differences of goji berries is low. At this time, a warning signal is generated, and the result of the image analysis algorithm in identifying the appearance differences of goji berries is classified as an inaccurate recognition result.

[0021] Preferably, in S5, if the accuracy of the image analysis algorithm in identifying the appearance differences of goji berries is low, predict the degree of abnormality of the accuracy of the image analysis algorithm in identifying the appearance differences of goji berries, and dynamically adjust the recognition strategy according to the prediction result, specifically:

[0022] Quantify the accuracy abnormality degree A by calculating the difference between the current prediction result and the expected result of the image analysis algorithm 异常 The expression is: where: Q is the number of samples of the test data, y iis the true quality label of the i-th wolfberry sample, is the prediction result of the image analysis algorithm for the i-th sample; based on the accuracy anomaly A 异常 , a threshold K is set. When the accuracy anomaly A 异常 exceeds the threshold K, it indicates that the recognition accuracy of the algorithm is low and needs to be adjusted.

[0023] Preferably, the final recognition strategy after dynamic adjustment is expressed as: where: is the prediction result after adjustment, is the prediction result of the original algorithm, Δy i is the deviation after adjustment according to the accuracy anomaly A 异常 , and the accuracy anomaly A is updated according to the new prediction result 异常 , and the improvement effect of the algorithm is evaluated in real time. The expression is: According to the feedback result A 异常 (t + 1) continuously optimizes the algorithm performance to improve the accuracy of wolfberry screening.

[0024] The present invention also provides a wolfberry screening system based on image analysis, including an image acquisition module, an image preprocessing and feature extraction module, an accuracy evaluation module, a sorting processing module, and a dynamic adjustment module;

[0025] Image acquisition module: Select wolfberry samples with different growth environments, maturities, varieties, and drying degrees, and take several images of different wolfberry samples under multiple lighting conditions through a high-resolution camera;

[0026] Image preprocessing and feature extraction module: Preprocess the acquired images, and use the gray-level co-occurrence matrix to extract the surface texture roughness features of the images for the preprocessed images, and extract the color distribution uniformity features of the images by converting the images into the HSV color space;

[0027] Accuracy evaluation module: Based on the extracted surface texture roughness features and color distribution uniformity features of the images, construct a data prediction model, and determine the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries according to the model output results;

[0028] Sorting processing module: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high, apply the image analysis algorithm to the actual production line, and sort the qualified and unqualified wolfberries according to the image analysis results;

[0029] Dynamic adjustment module: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the abnormal degree of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction results to improve the accuracy of wolfberry screening.

[0030] In the above technical solution, the technical effects and advantages provided by the present invention are as follows:

[0031] 1. The present invention obtains multi-dimensional image data by selecting diverse samples (including different growth environments, maturities, and varieties), and combines the gray-level co-occurrence matrix and the HSV color space to extract surface texture roughness and color distribution uniformity features, realizing a comprehensive characterization of the appearance features of wolfberries. The data prediction model constructed based on the features can evaluate and dynamically optimize the recognition accuracy of the image analysis algorithm, ensure that the screening system can adapt to the complexity of the wolfberry appearance, reduce the waste of high-quality wolfberries, and improve the screening efficiency.

[0032] 2. The present invention significantly improves the automation degree and accuracy of wolfberry screening. When the recognition accuracy is high, the algorithm can be directly deployed on the production line to achieve efficient sorting and reduce labor costs; when the recognition accuracy is low, by predicting the abnormal degree of accuracy and dynamically adjusting the strategy (such as optimizing feature extraction, model parameters, or thresholds), ensure that the system is continuously optimized. In addition, by quantifying the texture roughness index and the color uniformity index, scientifically and quantitatively evaluate the quality of wolfberries, reduce the negative impact of misjudgment on the enterprise's revenue and brand reputation, and promote the intelligent and standardized development of wolfberry screening technology. Description of the Drawings

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.

[0034] Figure 1 It is the method flow chart of the present invention.

[0035] Figure 2 It is the system module diagram of the present invention. Detailed Embodiments

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0037] Example 1. Please refer to Figure 1 and Figure 2 As shown, a wolfberry screening method based on image analysis in this example includes the following steps:

[0038] S1: Select wolfberry samples with different growth environments, maturities, varieties, and drying degrees, and take pictures with a high-resolution camera under multiple lighting conditions to obtain several images of different wolfberry samples;

[0039] S2: Preprocess the obtained images, and use the gray-level co-occurrence matrix to extract the surface texture roughness features of the images for the preprocessed images, and extract the color distribution uniformity features of the images by converting the images into the HSV color space;

[0040] S3: Based on the extracted surface texture roughness features and color distribution uniformity features of the images, construct a data prediction model, and determine the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries according to the model output results;

[0041] S4: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high, apply the image analysis algorithm to the actual production line, and sort the qualified and unqualified wolfberries according to the image analysis results;

[0042] S5: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the abnormal degree of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction results to improve the accuracy of wolfberry screening.

[0043] In S1, select wolfberry samples with different growth environments, maturities, varieties, and drying degrees, and take pictures with a high-resolution camera under multiple lighting conditions to obtain several images of different wolfberry samples. Specifically:

[0044] The diversity of sample selection is crucial because the appearance differences of wolfberries are often affected by the following factors:

[0045] Growth environment: Different geographical regions, climate conditions (such as temperature, humidity, precipitation, etc.) and soil types will have a significant impact on the appearance of wolfberries. For example, wolfberries grown in arid regions may be darker in color and their surfaces may be relatively dry; while wolfberries grown in humid regions may be more brightly colored and have smooth surfaces.

[0046] Maturity: Different wolfberry maturities (such as early maturity, late maturity) will affect their color, size and shape. For example, immature wolfberries may be green or yellow, while wolfberries with a higher maturity are red or orange.

[0047] Varietal differences: Different varieties of wolfberries (such as Ningxia wolfberries, Qinghai wolfberries, etc.) can lead to differences in their shape, size, color, and surface texture. Different varieties of wolfberries may vary in color saturation and fruit morphology.

[0048] Drying degree: The different drying degrees directly affect the surface characteristics and color of wolfberries. Over-dried wolfberries may change color, develop cracks, or become dry and hard; while under-dried wolfberries may have uneven colors and a wet surface.

[0049] Randomly collect samples from different production batches and wolfberry plantations in different regions to ensure that a wide range of environmental factors are covered. Classify and label the collected wolfberries, indicating information such as their growth environment, maturity, variety, drying degree, etc., for subsequent analysis.

[0050] The purpose of choosing a high-resolution camera for shooting is to ensure that the details of wolfberries are captured, especially key features such as surface texture, color distribution, and morphology. Use a high-resolution camera (such as an industrial camera with millions of pixels) to ensure that the surface texture and subtle color differences of wolfberries are captured. The camera's sensor needs to be sensitive enough to produce clear images under different lighting conditions. According to the actual application requirements, wolfberries can be photographed from different angles. For example, front, side, and inclined angles can help capture the appearance characteristics of wolfberries more comprehensively, especially when judging morphology, size, and surface defects. Different lighting conditions will affect the clarity and color performance of the image. During the experiment, use artificial light sources (such as LED lights, ring lights, etc.) to simulate different lighting environments to ensure that the images have good performance under various lighting conditions. To ensure that the appearance characteristics of wolfberries are clearly visible, a neutral color background, such as white or gray, can be used to reduce background interference.

[0051] Multiple-angle images of each sample need to be collected. Usually, at least 3 - 5 different-angle photos are taken for each sample. Images from different angles can help the system identify the three-dimensional morphological characteristics of wolfberries in subsequent processing. The resolution of the images is usually set to be higher than 300 DPI (dots per inch) to ensure that the images are clear enough to extract fine texture and color information.

[0052] The collected images should be properly stored to ensure that each image has relevant metadata (such as shooting date, shooting environment, wolfberry sample information, etc.) for subsequent image preprocessing, analysis, and modeling. All the collected images can be classified and stored by category (such as growth environment, maturity, variety, etc.). Common storage formats are JPEG or PNG, while ensuring the clarity of the images. For each sample image, record relevant metadata, such as: the growth environment of the sample (dry, humid, etc.), maturity (early maturity, medium maturity, late maturity), variety (Lycium barbarum L. from Ningxia, Lycium barbarum L. from Qinghai, etc.), drying degree (fully dried, semi-dried, etc.). These metadata provide necessary background information for subsequent image analysis and feature extraction.

[0053] Formulate standards based on the appearance characteristics of wolfberries (such as color, size, shape, texture, etc.) to clarify the characteristic ranges that wolfberries of different qualities should have. Manually assign labels to each image sample, such as: high quality, qualified, unqualified. After preliminary collection and labeling, through manual inspection, ensure the consistency of the images and labels, and eliminate any inconsistent or mislabeled situations. The manual inspection process can further correct some difficult-to-identify images.

[0054] S2: Preprocess the obtained images, and use the gray-level co-occurrence matrix to extract the surface texture roughness features of the preprocessed images, and extract the color distribution uniformity features of the images by converting the images to the HSV color space.

[0055] Noise may occur during the image acquisition process, especially in low-light environments. The purpose of denoising is to improve the quality of the images and reduce the impact of noise on feature extraction. Gaussian filtering (Gaussian Blur) can be used to smooth the images and reduce noise. Gaussian filtering blurs the images through a convolution kernel, eliminates random noise in the images, and retains the main structural features of the images. Median filtering has a good effect on removing salt-and-pepper noise (i.e., extremely bright or extremely dark pixel points in the images), and is especially suitable for removing isolated noise points.

[0056] To enhance the features of wolfberries in the images, contrast adjustment can be performed to improve the detail performance. This method enhances the contrast of the images by adjusting the pixel distribution, especially for those areas with low brightness. For objects like wolfberries with large color variations, enhancing the contrast helps to highlight the surface texture and color differences.

[0057] To ensure the consistency of the image data, size standardization and color standardization can be performed on the images. By unifying the image sizes, subsequent feature extraction operations become more consistent. Crop the images to the central area of the wolfberries to remove background interference, and at the same time adjust the image sizes to a unified standard (such as 224x224 pixels).

[0058] In image processing, color space conversion helps to extract color information in different dimensions. Common conversion methods include converting from RGB to the HSV space for better color analysis. The HSV color space (Hue, Saturation, and Value) is more in line with the human eye's perception of color than the RGB color space. The color model of HSV can better describe the color differences of goji berries. In particular, the hue (H) and saturation (S) are very helpful for identifying color uniformity and characteristics.

[0059] The Gray Level Co-occurrence Matrix (GLCM) is a common method for describing texture features by calculating the spatial relationship of image gray values. It can reflect the distribution of pixel gray levels in the image and their relative positions, thereby extracting the characteristics of surface texture roughness.

[0060] For each pixel point, consider its neighboring pixels (usually horizontal, vertical, or diagonal neighbors) and the relationship of their gray values. The GLCM matrix records the co-occurrence frequencies between different gray value pairs. Usually, pixel distance and direction are used as parameters to construct the matrix. For each image, calculate the GLCMs in multiple directions and distances. Common directions are: horizontal (0°), vertical (90°), diagonal (45° and 135°). The distance can be set to 1 pixel or a larger value.

[0061] Based on the constructed GLCM matrix, the following texture features can be extracted:

[0062] Contrast: Represents the degree of gray level change. A larger contrast indicates that the texture in the image changes more drastically, which may be related to the surface roughness of goji berries.

[0063] Homogeneity: Describes the smoothness of the image texture. An image with a higher homogeneity has a smoother surface.

[0064] Entropy: Describes the complexity of the image. The higher the entropy, the more complex the texture, and there may be more irregular defects on the surface.

[0065] Correlation: Measures the linear relationship between pixels. The higher the correlation, the more uniform the texture in the image.

[0066] By converting the image from the RGB space to the HSV space, color information can be more intuitively extracted. For the color feature analysis of goji berries, especially the color distribution uniformity, the HSV space is particularly suitable.

[0067] Hue: Hue represents the type of color. Chinese wolfberries are usually red or orange, so changes in hue can help determine color uniformity.

[0068] Saturation: Saturation represents the purity of color. Higher saturation indicates a more vivid color, while low saturation may indicate that the color of Chinese wolfberries is more faded or dull.

[0069] Value: Value represents the lightness or darkness of a color and is helpful for analyzing the dryness or evenness of drying on the surface of Chinese wolfberries.

[0070] Hue uniformity: By calculating the standard deviation of hue in the image, the color uniformity can be evaluated. A lower standard deviation indicates more uniform color, while a higher standard deviation indicates uneven color distribution.

[0071] Saturation uniformity: By calculating the standard deviation of saturation in the image, it can be evaluated whether there is uneven color on the surface of Chinese wolfberries. For example, mildew or uneven drying on the surface of Chinese wolfberries may cause changes in saturation.

[0072] Value uniformity: The uniformity of value can be evaluated by calculating the standard deviation of the value distribution of the image. Larger value differences may reflect uneven drying or surface defects of Chinese wolfberries.

[0073] After analyzing the extracted surface texture roughness features of the image, an image surface texture roughness index is generated. The method for obtaining the image surface texture roughness index is as follows:

[0074] Obtain a binary image. Usually, the image is converted into a black-and-white image through threshold processing or other methods. Binarization helps to remove unnecessary details and only retain information related to the surface texture. Use the box-counting method to estimate the fractal dimension. Cover the image with boxes of different sizes, count the number of pixel points covered by the boxes, and calculate the relationship between the coverage number and the box size for different box sizes. Select a series of different box sizes (usually from the smallest size to larger sizes). The size of each box is set to ∈ (grid size). These boxes will be used to cover the image. For each box size ∈, calculate how many boxes are needed to cover all non-zero pixels (i.e., the texture part in the image) in the image. Denote the box size as ∈, and calculate the number of pixels covered by each box as N(∈); perform a logarithmic transformation on the relationship between N(∈) and the box size ∈, and the expression is: ln(N(∈)) = Dln(1 / ∈); where D is the fractal dimension of the image, N(∈) is the number of boxes covered, and ∈ is the side length of the box.

[0075] Plot the relationship between ln(N(∈)) and ln(1 / ∈), and calculate its slope. The slope is the fractal dimension D of the image. By fitting the logarithmic image of the above-mentioned image, the fractal dimension D is obtained, and the expression is: The fractal dimension D can be used to describe the roughness of an image. Generally, the larger the fractal dimension, the more complex and rough the image surface is. Calculate the rough index of the image surface texture, and the expression is: EP = D - 2; where EP is the rough index of the image surface texture, and D - 2 is to associate the plane (2D image) with its corresponding fractal dimension, because in a two-dimensional plane, the fractal dimension is usually around 2. If D is close to 2, it means that the image surface is relatively smooth and has a low roughness. If D is closer to 3, it means that the image surface is more rough and has more complex details.

[0076] The larger the rough index of the image surface texture, generally means that the surface texture of the image is more complex and irregular, which may have a negative impact on the recognition accuracy of the image analysis algorithm. During the screening process of goji berries, more complex textures may cause the algorithm to be unable to accurately distinguish different types of goji berries, especially under similar appearance features, such as uneven color and slight shape differences. The algorithm may be interfered by the surface texture, resulting in incorrect classification or inaccurate recognition, thus affecting the screening quality, and may cause high-quality goji berries to be misjudged as low-quality or missed.

[0077] On the contrary, a smaller rough index of the image surface texture generally means that the image surface is relatively smooth and regular, which helps the image analysis algorithm better recognize the appearance features of goji berries. Simple and uniform surface features are easier to be accurately analyzed and distinguished by the algorithm, thus improving the recognition accuracy. At this time, the algorithm can more effectively judge the quality differences of goji berries, reduce misjudgments caused by texture complexity, and ultimately improve the screening efficiency and accuracy. Therefore, a lower roughness index helps to improve the recognition accuracy of the algorithm.

[0078] After analyzing the uniformity feature of the color distribution of the extracted image, an image color distribution uniformity index is generated. The method for obtaining the image color distribution uniformity index is:

[0079] First, convert the image from the RGB color space to the HSV color space (or HSL color space), because the hue channel in the HSV color space can better represent colors, and the saturation and value can be ignored when calculating the influence of color distribution on uniformity.

[0080] H (hue) represents the type of color, usually represented by an angular value (0° to 360°). S (saturation) represents the purity of the color, with a value ranging from 0 to 1, where 0 represents gray and 1 represents pure color. V (value) represents the brightness or intensity of the color, with a value ranging from 0 to 1, where 0 is black and 1 is the brightest.

[0081] For the converted HSV image, extract the pixel values of the Hue channel and calculate its histogram. Divide the hue range [0°, 360°] into several intervals (e.g., 360 intervals, each interval corresponding to a hue value). This can convert the hue information in the image into a discrete frequency distribution.

[0082] Count the number of pixels in each interval (hue bin) to obtain the hue histogram. For example, for the hue range [0°, 360°], divide it into 360 small intervals (one interval for each degree). Each pixel in the image corresponds to a hue value, and count the number of pixels in each hue interval.

[0083] The entropy of the histogram is an important indicator to measure the uniformity of the image color distribution. The larger the entropy, the more uniform the color distribution; the smaller the entropy, the more the colors are concentrated on a few colors. Calculate the entropy value of the hue histogram: where H is the hue entropy of the image, N is the number of intervals of the hue histogram (e.g., if the hue is divided into 360 intervals, then N = 360). p i is the proportion of pixels in the i-th hue interval, and the calculation method is: where n i is the number of pixels in the i-th interval, and the denominator is the total number of all pixels. Calculate the image color distribution uniformity index, and the expression is: DF = H / log(N); DF is the image color distribution uniformity index.

[0084] The larger the image color distribution uniformity index, the more uniform the color distribution in the image, the finer and richer the color differences, which usually helps the image analysis algorithm to more accurately identify the appearance characteristics of goji berries. When the color distribution of the image is relatively uniform, the algorithm can more clearly distinguish different types of goji berries, especially in the case of small color changes, and can accurately judge their quality. A higher uniformity index helps to reduce misjudgment and improve the recognition accuracy of the algorithm.

[0085] On the contrary, the smaller the image color distribution uniformity index, the more concentrated or biased the colors in the image are towards certain specific hues, which may cause deviations in the image analysis algorithm when identifying the appearance differences of goji berries. Uneven colors may cover up the true appearance characteristics of goji berries, making it difficult for the algorithm to accurately identify small color differences. Especially in the case of uneven color and surface defects of goji berries, high-quality goji berries are easily misjudged as low-quality, or low-quality goji berries are misjudged as qualified. Therefore, a smaller uniformity index will reduce the recognition accuracy of the algorithm.

[0086] S3: Based on the extracted surface texture roughness features and color distribution uniformity features of the image, construct a data prediction model, and determine the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries according to the model output results.

[0087] Normalize the image surface texture roughness index and the image color distribution uniformity index, and calculate the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries through the normalized image surface texture roughness index and the image color distribution uniformity index.

[0088] For example, the present invention can calculate the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries by using the following calculation expression of the data prediction model. The calculation expression is: In the formula, LK is the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries, EP is the image surface texture roughness index, DF is the image color distribution uniformity index, a1 and a2 are the proportionality coefficients of the image surface texture roughness index and the image color distribution uniformity index, and a2 > a1 > 0.

[0089] Compare the obtained accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries with the reference threshold of the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries set according to historical data. If the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries is greater than or equal to the preset reference threshold of the accuracy value, it indicates that the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high. At this time, no warning signal is generated, and the result of the image analysis algorithm in identifying the appearance differences of wolfberries is classified as an accurate recognition result. If the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries is less than the preset reference threshold of the accuracy value, it indicates that the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low. At this time, a warning signal is generated, and the result of the image analysis algorithm in identifying the appearance differences of wolfberries is classified as an inaccurate recognition result.

[0090] S4: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high, apply the image analysis algorithm to the actual production line, and sort the qualified and unqualified wolfberries according to the image analysis results.

[0091] If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is relatively high, it can be applied to the actual production line, and a high-resolution camera or camera is used to capture images of wolfberries in real time. According to the speed of the production line, an appropriate shooting frequency and image resolution can be selected to ensure that each wolfberry sample is clearly captured. Preprocess the collected images, such as denoising, adjusting the lighting, enhancing the contrast, etc., to ensure that the image quality meets the analysis requirements.

[0092] Use the trained image analysis algorithms (such as convolutional neural networks or feature-based classification algorithms) to analyze wolfberry images and extract their appearance features. The main features include the size, shape, color, surface texture, etc. of wolfberries. Extract key quality features from the images, such as surface texture roughness, color distribution uniformity, color difference degree, defect detection, etc. Through these features, the algorithm determines whether the wolfberries meet the quality standards.

[0093] According to the pre-set quality standards (such as the color, size, surface defects, etc. of the appearance), the algorithm classifies wolfberries into two categories: "qualified" and "unqualified". Qualified wolfberries: If the appearance of the wolfberries meets the set standards, the algorithm will determine them as qualified products and prepare to enter the packaging or further production process. Unqualified wolfberries: If there are defects in the wolfberries (such as uneven color, surface defects, or non-compliance with the specified size standards), the algorithm will mark them as unqualified and remove them.

[0094] Once the image analysis algorithm identifies the qualified and unqualified status of wolfberries, the automatic sorting system (such as robotic arms, pneumatic sorting devices, or vibrating sieves) will automatically separate the wolfberries according to the results output by the algorithm: Qualified wolfberries: Sent to the storage area for qualified products through devices such as conveyor belts and vibrating sieves. Unqualified wolfberries: The unqualified wolfberries are removed in a timely manner through equipment such as air jetting, robotic arm removal, or vibrating sieves to prevent them from entering the subsequent production process.

[0095] S5: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the degree of abnormality of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction results to improve the accuracy of wolfberry screening.

[0096] Quantify the accuracy abnormality degree A by calculating the difference between the current prediction result of the image analysis algorithm and the expected result 异常 , the expression is: where: Q is the number of samples of the test data, y i is the true quality label (such as qualified or unqualified) of the i-th wolfberry sample, is the prediction result (qualified or unqualified) of the image analysis algorithm for the i-th sample.

[0097] Based on the accuracy abnormality degree A 异常 , set a threshold K to determine when to dynamically adjust the strategy of the image analysis algorithm. When the accuracy abnormality degree A 异常 exceeds the threshold K, it indicates that the recognition accuracy of the algorithm is low and needs to be adjusted.

[0098] Adjust the image acquisition and preprocessing, specifically including: if the accuracy is low under specific lighting conditions, the exposure settings of the camera can be adjusted or additional light sources can be added to reduce the impact of uneven lighting. Increasing the resolution of the image can help the algorithm identify details more clearly, thereby improving accuracy.

[0099] Adjust the algorithm as follows: if there are misclassifications, it may be due to insufficient or unbalanced training data. Different environmental and variety samples can be added through data augmentation methods (such as rotation, scaling, color transformation, etc.) to enhance the generalization ability of the algorithm. Dynamically adjust the quality determination threshold according to the accuracy anomaly A 异常 and historical data. For example, if the algorithm performs poorly under specific conditions, the quality standard can be relaxed or tightened for adaptive adjustment.

[0100] The final recognition strategy after dynamic adjustment is expressed as: Where: is the adjusted prediction result, is the prediction result of the original algorithm, Δy i is the deviation adjusted according to the accuracy anomaly A 异常 which may come from retraining of the algorithm, threshold optimization or other adjustment measures.

[0101] The recognition strategy after dynamic adjustment can be further optimized through the following feedback loop: update the accuracy anomaly A 异常 according to the new prediction result, and evaluate the improvement effect of the algorithm in real time. The expression is: Adjust the parameters in multiple dimensions such as image acquisition, preprocessing, algorithm, and model according to the feedback results to continuously optimize the algorithm performance.

[0102] In this embodiment, first, wolfberry samples with different growth environments, maturities, varieties, and drying degrees are selected, and multiple images are taken and obtained using a high-resolution camera under various lighting conditions. Then, the images are preprocessed, and the surface texture roughness features and color distribution uniformity features are extracted. Based on these extracted features, a data prediction model is constructed to evaluate the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries. If the accuracy is high, the algorithm can be directly applied to the production line to automatically sort qualified and unqualified wolfberries. If the accuracy is low, the image analysis strategy is dynamically adjusted by predicting the accuracy anomaly degree to optimize the screening accuracy, thereby improving the sorting effect of wolfberries.

[0103] Embodiment 2. The wolfberry screening system based on image analysis described in this embodiment includes an image acquisition module, an image preprocessing and feature extraction module, an accuracy evaluation module, a sorting processing module, and a dynamic adjustment module;

[0104] Image acquisition module: Select wolfberry samples with different growth environments, maturities, varieties, and drying degrees, and take pictures under multiple lighting conditions using a high-resolution camera to obtain a number of images of different wolfberry samples;

[0105] Image preprocessing and feature extraction module: Preprocess the acquired images, and use the gray-level co-occurrence matrix to extract the surface texture roughness features of the images for the preprocessed images, and extract the color distribution uniformity features of the images by converting the images to the HSV color space;

[0106] Accuracy evaluation module: Based on the extracted surface texture roughness features and color distribution uniformity features of the images, construct a data prediction model, and determine the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries according to the model output results;

[0107] Sorting and processing module: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is high, apply the image analysis algorithm to the actual production line, and sort and process the qualified and unqualified wolfberries according to the image analysis results;

[0108] Dynamic adjustment module: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the abnormal degree of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction results to improve the accuracy of wolfberry screening.

[0109] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula that is closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0110] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. These three situations, where A and B can be singular or plural. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship. Specifically, it can be understood by referring to the context before and after.

[0111] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0112] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application.

Claims

1. A method for screening wolfberry based on image analysis, characterized in that: The following steps are involved: S1: Select wolfberry samples with different growth environments, maturity, varieties, and drying degrees, and use a high-resolution camera to shoot them under multiple lighting conditions to obtain several images of different wolfberry samples; S2: preprocessing the acquired image, and using the gray level co-occurrence matrix to extract the surface texture roughness characteristics of the image, and converting the image into the HSV color space to extract the color distribution uniformity characteristics of the image; S3: Based on the surface texture roughness characteristics and color distribution uniformity characteristics of the extracted images, a data prediction model is constructed, and the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is determined based on the model output results; S4: If the image analysis algorithm has high accuracy in identifying the appearance differences of wolfberries, the image analysis algorithm is applied to the actual production line, and qualified and unqualified wolfberries are sorted according to the image analysis results; S5: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, predict the abnormal degree of the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries, and dynamically adjust the recognition strategy according to the prediction result to improve the accuracy of wolfberry screening.

2. The method for screening wolfberries based on image analysis according to claim 1, characterized in that: In S2, the extracted image surface texture roughness features are analyzed to generate an image surface texture roughness index. The image surface texture roughness index is obtained as follows: Get a binary image, convert the image into black and white, use the box counting method to estimate the fractal dimension, cover the image with boxes of different sizes, count the number of pixels covered by the boxes, and calculate the relationship between the number of pixels covered and the box size under different box sizes; Select a series of boxes of different sizes, the size of each box is set to ∈, these boxes will be used to cover the image, for each box size ∈, calculate how many boxes are needed to cover all non-zero pixels in the image, the box size is ∈, and the number of pixels covered by each box is calculated as N(∈); The relationship between N∈ and the box size∈ is logarithmically transformed as follows: lnN∈=Dln1 / ∈; where D is the fractal dimension of the image, N(∈) is the number of covered boxes, and ∈ is the side length of the box; Draw the relationship between lnN∈ and ln1 / ∈, and calculate its slope. The slope is the fractal dimension D of the image. By fitting the logarithmic image of the image, the fractal dimension D is obtained. The expression is: The image surface texture roughness index is calculated using the expression: EP = D-2; where EP is the image surface texture roughness index.

3. The method for screening wolfberries based on image analysis according to claim 2, characterized in that: In S2, after analyzing the extracted image color distribution uniformity features, an image color distribution uniformity index is generated. The method for obtaining the image color distribution uniformity index is: Convert the image from RGB color space to HSV color space. For the converted HSV image, extract the pixel value of the hue channel and calculate its histogram, dividing the hue range into several intervals; count the number of pixels in each interval to obtain the hue histogram. Each pixel in the image corresponds to a hue value, and count the number of pixels in each hue interval; Calculate the entropy of the hue histogram: Among them, H is the hue entropy of the image, N is the number of intervals of the hue histogram, and p i is the pixel ratio of the ith tone interval, calculated as: Among them, n i is the number of pixels in the i-th interval, the denominator is the total number of all pixels, and the image color distribution uniformity index is calculated. The expression is: DF = H / logN; DF is the image color distribution uniformity index.

4. The method for screening wolfberries based on image analysis according to claim 3, characterized in that: In S3, the accuracy of the image analysis algorithm in identifying the differences in appearance of wolfberries is determined, specifically: The image surface texture roughness index and the image color distribution uniformity index are normalized, and the accuracy value of the image analysis algorithm in identifying the appearance differences of wolfberries is calculated based on the normalized image surface texture roughness index and the image color distribution uniformity index.

5. The method for screening wolfberries based on image analysis according to claim 4, characterized in that: The acquired accuracy value of the image analysis algorithm for identifying the appearance differences of wolfberries is compared with the reference threshold value of the image analysis algorithm for identifying the appearance differences of wolfberries set according to historical data. If the accuracy value of the image analysis algorithm for identifying the appearance differences of wolfberries is greater than or equal to the preset reference threshold value of the accuracy value, it means that the image analysis algorithm has high accuracy in identifying the appearance differences of wolfberries. In this case, no warning signal is generated, and the result of the image analysis algorithm for identifying the appearance differences of wolfberries is classified as an accurate recognition result. If the accuracy value of the image analysis algorithm for identifying the appearance differences of wolfberries is less than the preset reference threshold value of the accuracy value, it means that the accuracy of the image analysis algorithm for identifying the appearance differences of wolfberries is low. In this case, a warning signal is generated, and the result of the image analysis algorithm for identifying the appearance differences of wolfberries is classified as an inaccurate recognition result.

6. The method for screening wolfberries based on image analysis according to claim 1, characterized in that: In S5, if the accuracy of the image analysis algorithm in identifying the difference in appearance of wolfberries is low, the abnormal degree of the accuracy of the image analysis algorithm in identifying the difference in appearance of wolfberries is predicted, and the recognition strategy is dynamically adjusted according to the prediction result, specifically: The accuracy anomaly A is quantified by calculating the difference between the current prediction of the image analysis algorithm and the expected result. 异常 , the expression is: Where: Q is the number of samples of test data, y i is the true quality label of the i-th wolfberry sample, is the prediction result of the image analysis algorithm for the i-th sample; based on the accuracy anomaly A 异常 , set a threshold K, when the accuracy abnormality A 异常 When the threshold K is exceeded, it means that the algorithm recognition accuracy is low and needs to be adjusted.

7. The method for screening wolfberries based on image analysis according to claim 6, characterized in that: The final recognition strategy after dynamic adjustment is expressed as: in: is the adjusted forecast result, is the prediction result of the original algorithm, Δy i According to the accuracy anomaly A 异常 After the adjustment, update the accuracy anomaly A according to the new prediction results 异常 , the improvement effect of the real-time evaluation algorithm is expressed as: According to the feedback result A 异常 t+1 continues to optimize algorithm performance to improve the accuracy of wolfberry screening.

8. A wolfberry screening system based on image analysis, used to implement the wolfberry screening method based on image analysis according to any one of claims 1 to 7, characterized in that: It includes image acquisition module, image preprocessing and feature extraction module, accuracy assessment module, sorting processing module and dynamic adjustment module; Image acquisition module: select wolfberry samples with different growth environments, maturity, varieties, and drying degrees, and use a high-resolution camera to shoot them under multiple lighting conditions to obtain several images of different wolfberry samples; Image preprocessing and feature extraction module: preprocess the acquired image, and use the gray level co-occurrence matrix to extract the surface texture roughness characteristics of the image, and convert the image into HSV color space to extract the color distribution uniformity characteristics of the image; Accuracy evaluation module: Based on the surface texture roughness characteristics and color distribution uniformity characteristics of the extracted images, a data prediction model is constructed, and the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is determined based on the model output results; Sorting and processing module: If the image analysis algorithm has high accuracy in identifying the appearance differences of wolfberries, the image analysis algorithm is applied to the actual production line, and qualified and unqualified wolfberries are sorted according to the image analysis results; Dynamic adjustment module: If the accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is low, the abnormal degree of accuracy of the image analysis algorithm in identifying the appearance differences of wolfberries is predicted, and the recognition strategy is dynamically adjusted according to the prediction results to improve the accuracy of wolfberry screening.

Citation Information

Cited By

  • Bar discharging temperature intelligent sorting method and system

    CN121580354A

  • Dust pollution detection method and system based on image recognition

    CN121811163A