Red date coloring detection method and system based on image recognition system
Through the red date color conversion detection method based on the image recognition system, the problems of inefficient and strong subjectivity of traditional red date quality detection methods are solved, and the automation and intelligence of red date color conversion detection are realized, improving the detection efficiency and accuracy.
Patent Information
- Application Number
- CN202411796191.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-28
AI Technical Summary
Traditional red date quality detection methods rely on manual experience, are inefficient and subjective, and are difficult to meet the needs of modern large-scale production. The surface color of red dates is complex and changeable, so traditional image processing methods are difficult to accurately identify and distinguish.
The red date color conversion detection method based on the image recognition system is adopted, and the red date recognition model is automated to realize the red date color conversion process by collecting red date image samples, preprocessing, color space conversion, feature extraction and constructing a red date recognition model.
It improves the automation and intelligence level of red date quality inspection, improves the detection efficiency and accuracy, reduces labor costs, and enhances the objectivity and reliability of quality grading.
Smart Images

Figure CN119722819A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition, and in particular to a method and system for detecting color change of red dates based on an image recognition system. Background Art
[0002] As an important resource for both medicine and food, the quality of red dates is directly related to the health of consumers and the economic benefits of the market. Traditional methods for detecting the quality of red dates mainly rely on manual experience, which is inefficient and subjective, and cannot meet the needs of modern large-scale production. With the rapid development of image recognition technology, it is possible to use computer vision technology to automatically detect the color change of red dates. This method can improve the detection efficiency and accuracy and provide a scientific basis for the quality grading of red dates. However, the color of the surface of red dates is complex and changeable, and traditional image processing methods are difficult to accurately identify and distinguish. Therefore, developing a method for detecting the color change of red dates based on an image recognition system is of great significance for improving the automation and intelligence level of red date quality detection. Summary of the invention
[0003] To solve the technical problems in the above background, the present invention provides the following solutions:
[0004] A method for detecting color change of red dates based on an image recognition system, comprising the following steps:
[0005] Collect red date image samples and perform preprocessing to obtain processed data;
[0006] Performing color space conversion on the processed data;
[0007] Performing feature extraction on the processed data after color space conversion;
[0008] Based on the extracted features, a red date recognition model is constructed;
[0009] The red date recognition model is used to complete the red date color change detection.
[0010] Preferably, the method for performing the preprocessing includes: using an image segmentation algorithm to segment the red dates area from the red dates image, setting a color threshold, dividing the pixels in the image whose color values are greater than the threshold into the red dates area, and dividing the pixels whose color values are less than the threshold into the background area; when the number of collected samples is sparse, expanding the sample size through a data enhancement method.
[0011] Preferably, the method for color space conversion includes: using a color space conversion algorithm to convert the standardized red date image from the RGB color space to the HSV color space, extracting color feature parameters, and quantitatively describing the surface color attributes of the red dates, wherein the color feature parameters include: hue, saturation and brightness; and using a K-means clustering algorithm to cluster the HSV three channel values of the red date image to obtain cluster centers of different color attributes; according to the cluster centers, judging to which color attribute the red date image belongs, and determining the surface color of the red dates.
[0012] Preferably, the method for extracting features includes: using a local feature extraction algorithm to extract local features in different areas of an image to obtain a local feature descriptor; combining the extracted local features through a feature fusion strategy to generate a fused feature vector for enhancing the discriminability of the features; the method for extracting local features includes: using a local binary pattern algorithm to extract texture features of the image;
[0013] Use the Sobel operator to extract edge features of the image;
[0014] Use HOG features to describe the shape information of the image.
[0015] Preferably, a convolutional neural network model is used to construct the red date recognition model, and the structure of the red date recognition model includes:
[0016] The first convolution layer uses 32 convolution kernels of size 3x3;
[0017] The second and third convolutional layers use 64 convolution kernels of size 3x3;
[0018] The window size of the pooling layer is 3x3;
[0019] The activation function uses the ReLU function.
[0020] The present invention also provides a red date color change detection system based on an image recognition system, the system is used to implement the above method, and comprises: an acquisition module, a conversion module, an extraction module, a construction module and a recognition module;
[0021] The acquisition module is used to collect red date image samples and perform preprocessing to obtain processed data;
[0022] The conversion module is used to perform color space conversion on the processed data;
[0023] The extraction module is used to perform feature extraction on the processed data after color space conversion;
[0024] The construction module is used to construct a red date recognition model based on the extracted features;
[0025] The recognition module is used to complete the red date color change detection using the red date recognition model.
[0026] Preferably, the workflow of the acquisition module includes: using an image segmentation algorithm to segment the red dates area from the red dates image, setting a color threshold, dividing the pixels in the image whose color values are greater than the threshold into the red dates area, and dividing the pixels whose color values are less than the threshold into the background area; when the number of collected samples is sparse, expanding the sample size through a data enhancement method.
[0027] Preferably, the workflow of the conversion module includes: using a color space conversion algorithm to convert the standardized red date image from the RGB color space to the HSV color space, extracting color feature parameters, and quantitatively describing the surface color attributes of the red dates, wherein the color feature parameters include: hue, saturation and brightness; and using a K-means clustering algorithm to cluster the HSV three channel values of the red date image to obtain cluster centers of different color attributes; according to the cluster centers, judging to which color attribute the red date image belongs, and determining the surface color of the red dates.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention realizes the automated detection of the color change process of red dates by collecting red date image samples, preprocessing, color space conversion, feature extraction and building a red date recognition model, thereby effectively improving the detection efficiency and accuracy, reducing labor costs, and enhancing the objectivity and reliability of red date quality grading, which has a significant promoting effect on improving the automation level and market competitiveness of the red date processing industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0031] Figure 1 The figure is a schematic diagram of a method flow of an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] Embodiment 1
[0035] like Figure 1 FIG. 1 is a schematic diagram of the method flow of this embodiment, and the steps include:
[0036] S1. Collect red dates image samples and perform preprocessing to obtain processed data.
[0037] Obtain red date image samples of different varieties, different origins, and different growth conditions, extract the red date surface color feature vector for each sample, and establish a red date color feature database. Then, for each red date sample image, use an image segmentation algorithm to segment the red date area from the red date image. This embodiment uses a color-based threshold segmentation method, sets a color threshold, divides pixels in the image whose color values are greater than the threshold into the red date area, and divides pixels whose color values are less than the threshold into the background area, and obtains processed data.
[0038] If the number of collected samples is too small, the sample size is expanded through data enhancement methods. Specifically, for the collected original sample data, data enhancement techniques such as rotation, translation, scaling, flipping and other transformation operations are used to expand the number and diversity of samples.
[0039] S2. Perform color space conversion on the processed data.
[0040] The color space conversion algorithm is used to convert the standardized red date image from RGB color space to HSV color space, and the color feature parameters such as hue, saturation, and brightness are extracted to quantitatively describe the surface color attributes of the red date. The RGB image of the red date is obtained and converted into an HSV color space image. For the HSV image, the values of the three color channels of hue H, saturation S, and brightness V are extracted. According to the values of the three HSV channels extracted, the average hue, average saturation, and average brightness of the red date image are calculated. The K-means clustering algorithm is used to cluster the HSV three channel values of the red date image to obtain the cluster centers of different color attributes. According to the cluster center, it is determined which color attribute the red date image belongs to and the surface color of the red date is determined.
[0041] Specifically, the quality of red dates is closely related to their color. High-quality red dates usually present a deep red or dark red color. In order to grade the color quality of red dates, the acquired RGB image needs to be converted into an HSV color space image. The HSV color space is closer to human perception of color, and the color characteristics of red dates can be more effectively represented using the HSV color space. The three channels of the RGB color space represent the three colors of red, green, and blue, respectively, while the three channels of the HSV color space represent hue (H), saturation (S), and brightness (V), respectively. Hue represents the color itself, such as red, green, etc. Saturation represents the purity of the color. The higher the saturation, the purer the color. Brightness represents the brightness of the color. For the converted HSV image, extract the values of the three color channels H, S, and V. Assume that the HSV value of a pixel is (0, 1, 1), indicating that the pixel is pure red and has the highest brightness. The HSV value of another pixel is (30, 0.5, 0.5), indicating that the pixel is orange, with low color purity and brightness. By analyzing the HSV values of a large number of red dates images, it can be found that the hue values of high-quality red dates are usually concentrated in a certain range, and the saturation and brightness are also high. Next, according to the values of the three HSV channels extracted, the average hue, average saturation and average brightness of the red date image are calculated. For example, a red date image contains 10,000 pixels. The H, S, and V values of each pixel are calculated separately, and then the H values of all pixels are added and divided by 10,000 to obtain the average hue of the red date image. Similarly, the average saturation and average brightness can be calculated. These average values can be used to preliminarily judge the color characteristics of red dates.
[0042] In order to more accurately determine the color attributes of red dates, the K-means clustering algorithm is used to cluster the HSV three channel values, and the data points are divided into different clusters, so that the similarity of the data points within each cluster is high, and the similarity of the data points between different clusters is low. In this embodiment, the HSV values of the red date image are clustered into three categories, and three cluster centers are obtained, which represent the main color components in the red date image. According to the cluster center, it can be determined which color attribute the red date image belongs to.
[0043] After the color space conversion is completed, the color attributes of high-quality red dates are preset. It can be determined based on experience or expert knowledge. For example, the hue value of high-quality red dates is within a certain range, and the saturation and brightness are both high. If the similarity between the color attributes of red dates and the preset color attributes of high-quality red dates is greater than the threshold, it is determined to be a high-quality red date, otherwise it is determined to be a non-high-quality red date. For example, the HSV value of the preset high-quality red dates is (5, 0.9, 0.9), and the HSV value of the red dates to be tested is (7, 0.8, 0.8). The similarity between the two is high, and the red dates are determined to be high-quality red dates. Through color analysis, the quality of red dates can be quickly and effectively graded.
[0044] S3. Perform feature extraction on the processed data after color space conversion.
[0045] This step is mainly to learn the image features of high-quality red dates. Specifically, a local feature extraction algorithm is used to extract local features such as texture and edge in different areas of the image to obtain a local feature descriptor. Through a feature fusion strategy, the extracted local features are combined to generate a fused feature vector to enhance the discriminability of the feature. This embodiment uses a local binary pattern (LBP) algorithm to extract the texture features of the image, uses the Sobel operator to extract the edge features of the image, and uses the HOG (Histogram of Directed Gradients) feature to describe the shape information of the image. The extracted local features (LBP features, Sobel features, and HOG features) are combined through a feature fusion strategy to generate a fused feature vector to enhance the discriminability of the feature. Finally, the fused feature vector is subjected to dimensionality reduction processing by the principal component analysis method to remove redundant information. Feature fusion can effectively combine the advantages of different features and improve the expressiveness of features. For example, the fusion of texture features and edge features can better describe the surface features of red dates.
[0046] Specifically, the image is divided into several small areas, and the LBP value is calculated for each small area to obtain the texture feature descriptor of the area.
[0047] The process of extracting image edge features using the Sobel operator mainly includes the following steps:
[0048] First, the Sobel operator calculates the horizontal and vertical gradients of the image through two 3x3 convolution kernels, which correspond to the horizontal and vertical templates of the Sobel operator respectively. x and the vertical component G y As shown below:
[0049]
[0050] Next, these templates are convolved with the image to obtain the gradient strength of the image in the horizontal and vertical directions. Then, the square root of the sum of the squares of these two gradient strengths is calculated, that is:
[0051]
[0052] Where * represents the convolution operation; I represents the original image, to obtain the edge intensity map. Finally, the edge intensity map can be thresholded as needed to extract the final edge features.
[0053] The steps of using HOG (Histogram of Directed Gradients) features to describe image shape information include: first, the image is divided into several small connected areas, called cells; then, the gradient direction and magnitude of the image are calculated in each cell, and the gradient is obtained by the edge detection operator of the image obtained in the above steps; then, the gradient direction in each cell is quantized into several bins of the directional histogram, and the gradient magnitude is normalized and assigned to the corresponding bin; finally, the histograms of adjacent cells are merged into block descriptors to form the HOG feature vector of the image. This process can be summarized by the following formula:
[0054] Let I be the input image, (x, y) be the pixel coordinates, M and m be the gradient magnitude and direction of the image, respectively, then:
[0055]
[0056] m = arctan2(G y *I,G x *I)
[0057] Among them, G x and G y are the horizontal and vertical components of the Sobel operator.
[0058] Then, for each cell, the gradient direction histogram H is calculated k :
[0059]
[0060] Among them, wk(m) represents the weight function, which maps the gradient direction m to the nearest bin.
[0061] Finally, the histograms of neighboring cells are merged into a block descriptor to form the final HOG feature vector.
[0062] S4. Based on the extracted features, a red date recognition model is constructed.
[0063] This embodiment uses a convolutional neural network model to train and learn the features of high-quality red dates, and constructs a red date recognition model. The convolutional neural network extracts the key features of the red date image through multi-layer convolution and pooling operations. During the convolutional neural network training process, according to the characteristics of the red date recognition task, the appropriate network layer number, convolution kernel size, activation function and other hyperparameters are set, and the cross entropy loss function and the random gradient descent optimization algorithm are used to optimize the model. The trained convolutional neural network model is evaluated for performance using a test set sample, and the generalization ability and robustness of the model under different lighting conditions are judged by calculating indicators such as recognition accuracy and false recognition rate. If the model performance does not meet expectations, the model is improved by adjusting the network structure, optimizing the algorithm, increasing training data, etc., and the above training evaluation process is repeated until a red date recognition model that meets the robustness requirements is obtained.
[0064] The first convolution layer uses 32 3x3 convolution kernels to extract low-level features such as edges and textures of the red dates image. The second and third convolution layers use 64 3x3 convolution kernels to extract higher-level features. The window size of the pooling layer is 3x3, which can reduce the dimension of the feature map, reduce the amount of calculation, and improve the robustness of the model. At the same time, it can also capture a larger receptive field. The activation function uses the ReLU function.
[0065] By calculating indicators such as recognition accuracy and false recognition rate, we can judge the generalization ability and robustness of the model under different lighting conditions. For example, if the recognition accuracy of the model on the test set is above 95% and the false recognition rate is less than 5%, the model performance is considered good. If the model performance does not meet expectations, model improvements are needed.
[0066] S5. Use the red dates recognition model to complete the red dates color change detection.
[0067] Apply the trained model to actual scenarios. When a red date image is input, the model can accurately identify whether the red dates after color change are of high quality. By continuously collecting different red date image data, regularly performing incremental training and optimization on the red date recognition model, the red date recognition performance and robustness of the model under different conditions are continuously improved, and the model is adaptively updated. For example, a batch of new data is collected every month to update the model so that the model can adapt to new lighting environments and image changes.
[0068] Embodiment 2
[0069] The present embodiment provides a red date color change detection system based on an image recognition system, comprising: an acquisition module, a conversion module, an extraction module, a construction module and a recognition module; the acquisition module is used to acquire red date image samples and perform preprocessing to obtain processed data; the conversion module is used to perform color space conversion on the processed data; the extraction module is used to perform feature extraction on the processed data after the color space conversion; the construction module is used to construct a red date recognition model based on the extracted features; the recognition module is used to use the red date recognition model to complete red date color change detection.
[0070] The following will describe in detail how the present invention solves the technical problems in practical work in conjunction with this embodiment.
[0071] Firstly, the acquisition module is used to collect red dates image samples and preprocess them to obtain processed data.
[0072] Obtain red date image samples of different varieties, different origins, and different growth conditions, extract the red date surface color feature vector for each sample, and establish a red date color feature database. Then, for each red date sample image, use an image segmentation algorithm to segment the red date area from the red date image. This embodiment uses a color-based threshold segmentation method, sets a color threshold, divides pixels in the image whose color values are greater than the threshold into the red date area, and divides pixels whose color values are less than the threshold into the background area, and obtains processed data.
[0073] If the number of collected samples is too small, the sample size is expanded through data enhancement methods. Specifically, for the collected original sample data, data enhancement techniques such as rotation, translation, scaling, flipping and other transformation operations are used to expand the number and diversity of samples.
[0074] The processed data is then converted into color space using the conversion module.
[0075] The color space conversion algorithm is used to convert the standardized red date image from RGB color space to HSV color space, and the color feature parameters such as hue, saturation, and brightness are extracted to quantitatively describe the surface color attributes of the red date. The RGB image of the red date is obtained and converted into an HSV color space image. For the HSV image, the values of the three color channels of hue H, saturation S, and brightness V are extracted. According to the values of the three HSV channels extracted, the average hue, average saturation, and average brightness of the red date image are calculated. The K-means clustering algorithm is used to cluster the HSV three channel values of the red date image to obtain the cluster centers of different color attributes. According to the cluster center, it is determined which color attribute the red date image belongs to and the surface color of the red date is determined.
[0076] Specifically, the quality of red dates is closely related to their color. High-quality red dates usually present a deep red or dark red color. In order to grade the color quality of red dates, the acquired RGB image needs to be converted into an HSV color space image. The HSV color space is closer to human perception of color, and the color characteristics of red dates can be more effectively represented using the HSV color space. The three channels of the RGB color space represent the three colors of red, green, and blue, respectively, while the three channels of the HSV color space represent hue (H), saturation (S), and brightness (V), respectively. Hue represents the color itself, such as red, green, etc. Saturation represents the purity of the color. The higher the saturation, the purer the color. Brightness represents the brightness of the color. For the converted HSV image, extract the values of the three color channels H, S, and V. Assume that the HSV value of a pixel is (0, 1, 1), indicating that the pixel is pure red and has the highest brightness. The HSV value of another pixel is (30, 0.5, 0.5), indicating that the pixel is orange, with low color purity and brightness. By analyzing the HSV values of a large number of red dates images, it can be found that the hue values of high-quality red dates are usually concentrated in a certain range, and the saturation and brightness are also high. Next, according to the values of the three HSV channels extracted, the average hue, average saturation and average brightness of the red date image are calculated. For example, a red date image contains 10,000 pixels. The H, S, and V values of each pixel are calculated separately, and then the H values of all pixels are added and divided by 10,000 to obtain the average hue of the red date image. Similarly, the average saturation and average brightness can be calculated. These average values can be used to preliminarily judge the color characteristics of red dates.
[0077] In order to more accurately determine the color attributes of red dates, the K-means clustering algorithm is used to cluster the HSV three channel values, and the data points are divided into different clusters, so that the similarity of the data points within each cluster is high, and the similarity of the data points between different clusters is low. In this embodiment, the HSV values of the red date image are clustered into three categories, and three cluster centers are obtained, which represent the main color components in the red date image. According to the cluster center, it can be determined which color attribute the red date image belongs to.
[0078] After the color space conversion is completed, the color attributes of high-quality red dates are preset. It can be determined based on experience or expert knowledge. For example, the hue value of high-quality red dates is within a certain range, and the saturation and brightness are both high. If the similarity between the color attributes of red dates and the preset color attributes of high-quality red dates is greater than the threshold, it is determined to be a high-quality red date, otherwise it is determined to be a non-high-quality red date. For example, the HSV value of the preset high-quality red dates is (5, 0.9, 0.9), and the HSV value of the red dates to be tested is (7, 0.8, 0.8). The similarity between the two is high, and the red dates are determined to be high-quality red dates. Through color analysis, the quality of red dates can be quickly and effectively graded.
[0079] The extraction module is used to extract features from the processed data after color space conversion.
[0080] This step is mainly to learn the image features of high-quality red dates. Specifically, a local feature extraction algorithm is used to extract local features such as texture and edge in different areas of the image to obtain a local feature descriptor. Through a feature fusion strategy, the extracted local features are combined to generate a fused feature vector to enhance the discriminability of the feature. This embodiment uses a local binary pattern (LBP) algorithm to extract the texture features of the image, uses the Sobel operator to extract the edge features of the image, and uses the HOG (Histogram of Directed Gradients) feature to describe the shape information of the image. The extracted local features (LBP features, Sobel features, and HOG features) are combined through a feature fusion strategy to generate a fused feature vector to enhance the discriminability of the feature. Finally, the fused feature vector is subjected to dimensionality reduction processing by the principal component analysis method to remove redundant information. Feature fusion can effectively combine the advantages of different features and improve the expressiveness of features. For example, the fusion of texture features and edge features can better describe the surface features of red dates.
[0081] Specifically, the image is divided into several small areas, and the LBP value is calculated for each small area to obtain the texture feature descriptor of the area.
[0082] The process of extracting image edge features using the Sobel operator mainly includes the following steps:
[0083] First, the Sobel operator calculates the horizontal and vertical gradients of the image through two 3x3 convolution kernels, which correspond to the horizontal and vertical templates of the Sobel operator respectively. x and the vertical component G y As shown below:
[0084]
[0085] Next, these templates are convolved with the image to obtain the gradient strength of the image in the horizontal and vertical directions. Then, the square root of the sum of the squares of these two gradient strengths is calculated, that is:
[0086]
[0087] Where * represents the convolution operation; I represents the original image, to obtain the edge intensity map. Finally, the edge intensity map can be thresholded as needed to extract the final edge features.
[0088] The steps of using HOG (Histogram of Directed Gradients) features to describe image shape information include: first, the image is divided into several small connected areas, called cells; then, the gradient direction and magnitude of the image are calculated in each cell, and the gradient is obtained by the edge detection operator of the image obtained in the above steps; then, the gradient direction in each cell is quantized into several bins of the directional histogram, and the gradient magnitude is normalized and assigned to the corresponding bin; finally, the histograms of adjacent cells are merged into block descriptors to form the HOG feature vector of the image. This process can be summarized by the following formula:
[0089] Let I be the input image, (x, y) be the pixel coordinates, M and m be the gradient magnitude and direction of the image, respectively, then:
[0090]
[0091] m = arctan2(G y *I,G x *I)
[0092] Among them, G x and G y are the horizontal and vertical components of the Sobel operator.
[0093] Then, for each cell, the gradient direction histogram H is calculated k :
[0094]
[0095] Among them, wk(m) represents the weight function, which maps the gradient direction m to the nearest bin.
[0096] Finally, the histograms of neighboring cells are merged into a block descriptor to form the final HOG feature vector.
[0097] The building module is used to construct a red date recognition model based on the extracted features.
[0098] This embodiment uses a convolutional neural network model to train and learn the features of high-quality red dates, and constructs a red date recognition model. The convolutional neural network extracts the key features of the red date image through multi-layer convolution and pooling operations. During the convolutional neural network training process, according to the characteristics of the red date recognition task, the appropriate network layer number, convolution kernel size, activation function and other hyperparameters are set, and the cross entropy loss function and the random gradient descent optimization algorithm are used to optimize the model. The trained convolutional neural network model is evaluated for performance using a test set sample, and the generalization ability and robustness of the model under different lighting conditions are judged by calculating indicators such as recognition accuracy and false recognition rate. If the model performance does not meet expectations, the model is improved by adjusting the network structure, optimizing the algorithm, increasing training data, etc., and the above training evaluation process is repeated until a red date recognition model that meets the robustness requirements is obtained.
[0099] The first convolution layer uses 32 3x3 convolution kernels to extract low-level features such as edges and textures of the red dates image. The second and third convolution layers use 64 3x3 convolution kernels to extract higher-level features. The window size of the pooling layer is 3x3, which can reduce the dimension of the feature map, reduce the amount of calculation, and improve the robustness of the model. At the same time, it can also capture a larger receptive field. The activation function uses the ReLU function.
[0100] By calculating indicators such as recognition accuracy and false recognition rate, we can judge the generalization ability and robustness of the model under different lighting conditions. For example, if the recognition accuracy of the model on the test set is above 95% and the false recognition rate is less than 5%, the model performance is considered good. If the model performance does not meet expectations, model improvements are needed.
[0101] Finally, the recognition module uses the red date recognition model to complete the red date color change detection.
[0102] Apply the trained model to actual scenarios. When a red date image is input, the model can accurately identify whether the red dates after color change are of high quality. By continuously collecting different red date image data, regularly performing incremental training and optimization on the red date recognition model, the red date recognition performance and robustness of the model under different conditions are continuously improved, and the model is adaptively updated. For example, a batch of new data is collected every month to update the model so that the model can adapt to new lighting environments and image changes.
[0103] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for detecting color change of red dates based on an image recognition system, characterized in that the steps include: Collect red date image samples and perform preprocessing to obtain processed data; Performing color space conversion on the processed data; Performing feature extraction on the processed data after color space conversion; Based on the extracted features, a red date recognition model is constructed; The red dates recognition model is used to complete the red dates color change detection.
2. The method for detecting color change of red dates based on an image recognition system according to claim 1, characterized in that: The method for performing the preprocessing includes: using an image segmentation algorithm to segment a red date area from a red date image, setting a color threshold, dividing pixels in the image whose color values are greater than the threshold into the red date area, and dividing pixels whose color values are less than the threshold into the background area; when the number of collected samples is sparse, expanding the sample size by a data enhancement method.
3. The method for detecting color change of red dates based on an image recognition system according to claim 1, characterized in that: The method for color space conversion includes: using a color space conversion algorithm to convert a standardized red date image from an RGB color space to an HSV color space, extracting color feature parameters, and quantitatively describing the surface color attributes of the red dates, wherein the color feature parameters include: hue, saturation, and brightness; and using a K-means clustering algorithm to cluster the HSV three channel values of the red date image to obtain cluster centers of different color attributes; and according to the cluster centers, judging to which color attribute the red date image belongs, and determining the surface color of the red date.
4. The method for detecting color change of red dates based on an image recognition system according to claim 1, characterized in that: The method for extracting features includes: using a local feature extraction algorithm to extract local features in different areas of an image to obtain a local feature descriptor; combining the extracted local features through a feature fusion strategy to generate a fused feature vector for enhancing the discriminability of the features; the method for extracting local features includes: using a local binary pattern algorithm to extract texture features of an image; Use the Sobel operator to extract edge features of the image; Use HOG features to describe the shape information of the image.
5. The method for detecting color change of red dates based on an image recognition system according to claim 1, characterized in that: The red date recognition model is constructed by using a convolutional neural network model. The structure of the red date recognition model includes: The first convolutional layer uses 32 convolution kernels of size 3x3; The second and third convolutional layers use 64 convolution kernels of size 3x3; The window size of the pooling layer is 3x3; The activation function uses the ReLU function.
6. A red date color change detection system based on an image recognition system, the system being used to implement the method according to any one of claims 1 to 5, characterized in that: include: Acquisition module, conversion module, extraction module, construction module and recognition module; The acquisition module is used to collect red date image samples and perform preprocessing to obtain processed data; The conversion module is used to perform color space conversion on the processed data; The extraction module is used to perform feature extraction on the processed data after color space conversion; The construction module is used to construct a red date recognition model based on the extracted features; The recognition module is used to complete the red date color change detection using the red date recognition model.
7. The red date color change detection system based on the image recognition system according to claim 6, characterized in that: The workflow of the acquisition module includes: using an image segmentation algorithm to segment the red dates area from the red dates image, setting a color threshold, dividing the pixels in the image whose color values are greater than the threshold into the red dates area, and dividing the pixels whose color values are less than the threshold into the background area; when the number of collected samples is sparse, the sample size is expanded by a data enhancement method.
8. The red date color change detection system based on the image recognition system according to claim 6, characterized in that: The workflow of the conversion module includes: using a color space conversion algorithm to convert the standardized red date image from the RGB color space to the HSV color space, extracting color feature parameters, and quantitatively describing the surface color attributes of the red dates, wherein the color feature parameters include: hue, saturation and brightness; and using a K-means clustering algorithm to cluster the HSV three channel values of the red date image to obtain cluster centers of different color attributes; according to the cluster centers, judging which color attribute the red date image belongs to, and determining the surface color of the red date.
Citation Information
Cited By
Red date image detection method and system
CN121095684A