A data mining method and system based on self-learning
Through self-learning data mining method, the static and dynamic characteristics of fresh food products are extracted, cluster analysis and dynamic spatiotemporal map construction are carried out, which solves the problem of the fresh food product recognition system having high sensitivity to dynamic feature changes and poor recognition stability. Accurate detection and identification of freshness of fresh products is achieved.
Patent Information
- Application Number
- CN202411480011.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-23
AI Technical Summary
In the prior art, the fresh product identification system has high sensitivity to changes in the dynamic characteristics of fresh food, poor recognition stability, and is difficult to adapt to the nonlinear characteristics of the freshness of fresh food products.
Using self-learning-based data mining method, by obtaining time series image data of fresh products, extracting static and dynamic features, performing cluster analysis, constructing dynamic spatio-temporal maps, and using self-learning mining model to train similar groups to achieve the Detection and identification of freshness of fresh products.
It improves the identification accuracy and reliability of fresh products under different freshness levels, overcomes the identification problems caused by dynamic characteristics changes, and realizes dynamic tracking and prediction of changes in fresh products' status.
Smart Images

Figure CN119003811B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, in particular to the technical field of information retrieval, and specifically to a data mining method and system based on self-learning. Background Art
[0002] Data mining is the process of extracting useful information and patterns from large amounts of data. It is usually related to computer science and is implemented through many methods such as statistics, online analytical processing, information retrieval, machine learning, expert systems, and pattern recognition. In the field of fresh product identification, data mining can be used to improve identification accuracy, optimize classification strategies, etc. By mining the time series image data of fresh products, the characteristic changes of different products at different freshness levels can be discovered.
[0003] In the quality control and management of fresh food, traditional visual inspection usually relies on manually set rules or template matching to identify and classify products. However, this method has certain limitations for fresh food, because the appearance characteristics of fresh food change with the change of freshness, and this change may be nonlinear, and manually set rules are difficult to adapt to all situations.
[0004] In order to overcome these problems, combining data mining and visual inspection technology, especially deep self-learning technology, can automatically learn feature representation from a large amount of labeled data, handle complex pattern recognition tasks, and in many cases exceed the level of human experts. By collecting time series image data of different products and extracting their static and dynamic features, an intelligent inspection system that can adapt to changes in product freshness can be built.
[0005] Therefore, it is necessary to improve the data mining method and system based on self-learning in the prior art to solve the above problems. Summary of the invention
[0006] The present invention overcomes the shortcomings of the prior art and provides a data mining method and system based on self-learning, aiming to solve the problems in the prior art that the system is highly sensitive to changes in dynamic characteristics of fresh food and has poor recognition stability.
[0007] To achieve the above object, the technical solution adopted by the present invention is: a data mining method based on self-learning, comprising:
[0008] S1. Obtain time series image data of different fresh products and extract static and dynamic features of each product as labels;
[0009] S2. Based on the similarity of the dynamic features, cluster analysis is performed on the dynamic features, and the fresh products with dynamic features of similar change patterns are regarded as a similar group;
[0010] S3, construct dynamic spatiotemporal graphs of different batches of fresh products;
[0011] S4, inputting the extracted labels and product data of similar groups into the constructed self-learning mining model and training it for similar groups;
[0012] S5. Continuously update the similarity groups of the dynamic spatiotemporal graph with the results of self-learning data mining to detect and identify the freshness of fresh products.
[0013] In a preferred embodiment of the present invention, in step S1, static features refer to features that are relatively stable throughout the life cycle of the fresh product and are not easily affected by external factors including time and lighting conditions, including: inherent properties of the product's shape, color, and texture;
[0014] Dynamic characteristics are those that change as the freshness of fresh products changes over time, including: the product's gloss, degree of decay, and smell.
[0015] In a preferred embodiment of the present invention, the static feature extraction process is as follows:
[0016] Shape feature extraction: Use Canny or Sobel edge detection algorithm to extract edge information in the image;
[0017] Color feature extraction: Use the low-order moments of color to represent the color features of the image; convert the image to HSV or Lab color space, and calculate the mean, variance, and skewness of each color channel; the mean describes the center position of the color distribution, the variance describes the degree of dispersion of the color distribution, and the skewness describes the asymmetry of the color distribution; combine all the calculated low-order moment values to form a feature vector;
[0018] Texture feature extraction: Divide the image into multiple small areas, compare the pixels in each area with the pixels in its neighborhood, generate binary codes based on the comparison results, and thus extract the texture features of the image.
[0019] In a preferred embodiment of the present invention, the dynamic feature extraction process is as follows:
[0020] Gloss feature extraction of products: Gloss features are extracted by analyzing the changes in the highlight area in the image:
[0021] Decay degree feature extraction: Extract decay degree features by identifying the area and distribution of decayed areas in the image;
[0022] Odor feature extraction: Indirect extraction through sensor data associated with time series image data.
[0023] In a preferred embodiment of the present invention, in step S1, labels are defined according to actual needs, including: freshness level, degree of corruption and classification of fresh varieties; the freshness level is divided into: fresh, sub-fresh and rotten; through the database, the extracted static features and dynamic features are associated with the defined labels.
[0024] In a preferred embodiment of the present invention, in step S3, constructing a dynamic spatiotemporal graph of different batches of fresh products includes:
[0025] S31. Define the node type in the graph as product, set the basic attribute framework of each node, including: product ID, batch number, collection time, static features, dynamic features; define the edge type connecting the nodes as time series;
[0026] S32, import the obtained time series feature data of different fresh products, create a node for each product at each time point of each batch, and assign corresponding attributes;
[0027] S33. Create edges between the associated time point product nodes, and assign a weight to each edge.
[0028] In a preferred embodiment of the present invention, in step S4, the step of self-learning mining model includes:
[0029] Select a machine learning model and initialize model parameters; machine learning models include: neural network, support vector machine and decision tree;
[0030] Use the training data set to adjust the model parameters and minimize the loss function;
[0031] Mean squared error is used for regression tasks, and cross entropy loss is used for classification tasks;
[0032] Mean square error , cross entropy loss ; Is the real label and predicted values The residual between .
[0033] In a preferred embodiment of the present invention, the step of training the similarity group includes:
[0034] For each similarity group, calculate the center point of the eigenvector of its internal members;
[0035] Similarity Group Include feature vector , the center point of the calculation group is , It is The feature vectors of similar groups;
[0036] Design a weight reduction function Reduce the individual feature vectors in similar groups Contribution during training; ; is the eigenvector With group center The distance between is a constant used to control the width of the weight reduction function;
[0037] During the training process, when calculating the loss function, the weight reduction function is applied to adjust the loss contribution of individual samples in similar groups. The modified loss function is: , It is The weight reduction factor of the sample.
[0038] In a preferred embodiment of the present invention, in step S5, new nodes and edges are added;
[0039] For new nodes and existing nodes , assuming they belong to the same similar group , then adjust the weight according to the weight reduction function: ,in Is a node Weight reduction factor ; For new nodes and existing nodes Euclidean distance between eigenvectors; The new node Eigenvector of; similarity group The central point eigenvector of ; Is a constant used to control the width of the weight reduction function.
[0040] The present invention provides a data mining system based on self-learning, comprising modules:
[0041] Data acquisition module, used to obtain time series image data of different fresh products from different environments;
[0042] Data preprocessing module, used to preprocess the collected image data, including image denoising, enhancement and cropping, to ensure that all images have consistent resolution and format;
[0043] Feature extraction module, used to extract static features and dynamic features from the preprocessed image;
[0044] A cluster analysis module, used to perform cluster analysis based on the similarity of dynamic features, and regard fresh products with dynamic features of similar change patterns as a similar group;
[0045] Dynamic spatiotemporal graph construction module, used to construct dynamic spatiotemporal graphs of different batches of fresh products;
[0046] A self-learning mining module, which is used to input the extracted labels and product data of similar groups into the self-learning mining model and train it for similar groups;
[0047] The dynamic space-time graph updating module is used to continuously update the dynamic space-time graph with the results of self-learning mining data.
[0048] In a preferred embodiment of the present invention,
[0049] The present invention solves the defects existing in the background technology and has the following beneficial effects:
[0050] (1) The present invention first collects time series image data of different fresh products at various freshness stages, extracts static features and dynamic features from them, and defines labels by analyzing these features. The labels associate static features with dynamic features to form a comprehensive description. Then, according to the changing rules of dynamic features, products with similar change patterns are classified into the same similarity group. On this basis, these labels and similarity group data are used to train a self-learning mining model, focusing on improving the recognition ability of similar group products. Finally, the mining results are fed back to the system's dynamic spatiotemporal graph to update the node attributes in the graph, thereby continuously optimizing the recognition algorithm. This method can not only effectively overcome the recognition difficulties caused by the changes in dynamic features, but also provide a stable recognition benchmark through static features, thereby significantly improving the accuracy and reliability of fresh product recognition at different freshness levels.
[0051] (2) The present invention constructs a dynamic spatiotemporal graph of different batches of fresh products by combining step S3 and step S4, and applies a self-learning mining model for training on this basis. Define the node type as product, assign basic attributes to each node, create edges between product nodes at associated time points, assign weights, then select a suitable machine learning model, use the training data set to adjust the model parameters, minimize the loss function, and achieve dynamic tracking and prediction of fresh product state changes. Compared with the prior art, it further achieves the purpose of real-time monitoring and evaluation of fresh product quality.
[0052] (3) The present invention performs cluster analysis based on the similarity of dynamic features and successfully divides fresh products with similar change patterns into similar groups. The innovation of this step is that it can not only identify products that exhibit similar dynamic behaviors at different freshness stages, but also provide a more targeted data set for subsequent model training. Compared with the prior art, the cluster analysis of the present invention improves the efficiency of data processing and provides more representative samples for model training through the identification of similar groups, which helps to improve the generalization ability and prediction accuracy of the model.
[0053] (4) The present invention obtains time series image data of different fresh products from production line monitoring, laboratory environment, retail environment monitoring and historical data accumulation through step S1, and extracts static features and dynamic features as labels. This process not only ensures the diversity and comprehensiveness of the data, but also provides a solid foundation for subsequent analysis through fine feature extraction. Compared with the prior art, the present invention is more detailed in feature extraction, not only considering static features, but also incorporating dynamic features that change over time, so as to more comprehensively reflect the status of fresh products.
[0054] (5) The present invention inputs the extracted labels and product data of similar groups into the self-learning mining model for training, and designs a weight reduction function to reduce the contribution of individual feature vectors in the similar groups during the training process. Not only can the self-learning mining model be used to achieve continuous model optimization and updating, but also the weight reduction function can be used to avoid data redundancy and overfitting problems. Compared with the prior art, the self-learning mining model of the present invention has stronger adaptability and higher training efficiency, and can converge to the optimal solution more quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. 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 be obtained based on these drawings without creative work.
[0056] Figure 1 is a flow chart of a preferred embodiment of the present invention;
[0057] Figure 2 It is a module diagram of a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0058] 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.
[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0060] Application Overview:
[0061] In the field of freshness detection of fresh products, traditional scales combined with visual inspection technology usually rely on the static appearance characteristics of the product to distinguish types and evaluate freshness. However, in actual applications, as the freshness of fresh products decreases, the original appearance characteristics will gradually disappear or become blurred, resulting in increased errors in the scale's recognition process.
[0062] Especially when different types of fresh products are at similar freshness stages, their dynamic features are likely to be highly similar, which further exacerbates the difficulty of identification, not only affecting the accuracy of fresh product quality control, but also posing challenges to supply chain management. Therefore, existing fresh product identification technologies have shortcomings such as high sensitivity to dynamic feature changes and poor identification stability.
[0063] In visual inspection, we mainly rely on old features of fresh products to distinguish product types. However, when these features are lost or become less significant during the spoilage process, the accuracy of individual feature learning will drop significantly. In addition, the dynamic features of different products at different freshness levels may be similar, which further increases the difficulty and uncertainty of individual feature learning.
[0064] In response to the above problems, this application proposes a self-learning-based data mining method, which aims to improve the accuracy and stability of fresh product identification by combining static features and dynamic features.
[0065] A data mining method based on self-learning, comprising the steps of:
[0066] S1. Obtain time series image data of different fresh products and extract static and dynamic features of each product as labels;
[0067] S2. Based on the similarity of the dynamic features, cluster analysis is performed on the dynamic features, and the fresh products with dynamic features of similar change patterns are regarded as a similar group;
[0068] S3, construct dynamic spatiotemporal graphs of different batches of fresh products;
[0069] S4, inputting the extracted labels and product data of similar groups into the constructed self-learning mining model and training it for similar groups;
[0070] S5, continuously updating the similarity groups of the dynamic spatiotemporal graph with the results of self-learning data mining, and detecting and identifying the freshness of fresh products;
[0071] Time series image data of different fresh products refers to a collection of images taken at multiple time points of a specific fresh product from its fresh state to its decay process under the same environment; the image collection records the changes in the appearance of the product over time, including: color, texture, and the appearance and expansion of spots. By comparing images at different times, static and dynamic features can be extracted to form label data for subsequent analysis.
[0072] In step S1, time series image data of different fresh products are obtained from production line monitoring, laboratory environment, retail environment monitoring and historical data accumulation;
[0073] In step S1, static features refer to features that are relatively stable throughout the life cycle of fresh products and are not easily affected by external factors such as time and lighting conditions, including inherent attributes such as product shape, color and texture. Static features are stable and reliable, not easily affected by external factors, and help maintain recognition stability when dynamic features change.
[0074] Dynamic features refer to features that change as the freshness of fresh products changes over time, including: the product's gloss, degree of decay, and smell. Dynamic features change during the decay process, but when considered together with static features, they can more effectively capture the overall state of the product.
[0075] In step S1, the collected image data is preprocessed, including: image denoising, enhancement and cropping; ensuring that all images have consistent resolution and format;
[0076] The static feature extraction process is as follows:
[0077] Shape feature extraction: Use the Canny or Sobel edge detection algorithm to extract edge information in the image and then describe the shape characteristics of fresh products;
[0078] Specifically, suppose the result of edge detection is ,in is the edge map, 1 represents edge, 0 represents non-edge; are the column and row coordinates of pixels in the image;
[0079] area ;perimeter ; Compactness ; Roundness ;
[0080] Combined shape feature vector ;
[0081] Color feature extraction: Use the low-order moments of color to represent the color features of the image; convert the image to HSV or Lab color space, and calculate the mean, variance, and skewness of each color channel; the mean describes the center position of the color distribution, the variance describes the degree of dispersion of the color distribution, and the skewness describes the asymmetry of the color distribution; combine all the calculated low-order moment values to form a feature vector;
[0082] Suppose the number of pixels in the image is ; Then the color low-order moment can be calculated according to the following formula: For each color channel , are hue, saturation and brightness; mean: ,in It is color channels of each pixel The value of; variance: ; Skewness: ;
[0083] The combined color feature vector is .
[0084] Texture feature extraction: Divide the image into multiple small areas, compare the pixels in each area with the pixels in its neighborhood, generate binary codes based on the comparison results, and thus extract the texture features of the image;
[0085] Assume the image is divided into small areas, each of which generates a Binary encoding; the final texture feature can be expressed as a The matrix of For the A small area Texture feature values: .
[0086] The dynamic feature extraction process is as follows:
[0087] Gloss feature extraction of products: Gloss features are extracted by analyzing the changes in the highlight area in the image:
[0088] set up is the coordinate in the image The pixel intensity value at is the highlight area set; the total number of pixels in the highlight area ; Average brightness value of highlight area ; Final gloss characteristics ;
[0089] Decay degree feature extraction: Extract decay degree features by identifying the area and distribution of decayed areas in the image;
[0090] set up is the total area of decayed areas, For the decay area collection, for the distribution of decay areas; ; ; Characteristics of final decay degree ;
[0091] Odor feature extraction: Indirect extraction through sensor data associated with time series image data;
[0092] set up For time The concentration of odor at is the rate of change of odor concentration; Final odor characteristics .
[0093] In step S1, labels are defined according to actual needs, including: freshness level, degree of corruption, and fresh variety classification;
[0094] Freshness levels are divided into: fresh, sub-fresh and rotten;
[0095] The extracted static and dynamic features are associated with the defined tags through the database.
[0096] In step S2, since the dimensions and units of different features may be different, the data needs to be standardized. , is the original eigenvalue, is the standardized eigenvalue, is the average value of the feature in the entire dataset, is the standard for the feature to ensure that the clustering algorithm can compare features fairly;
[0097] The clustering method is one of K-means, hierarchical clustering, and DBSCAN;
[0098] Take K-means clustering as an example: ,in, is the number of clusters, It is All samples in a cluster, Represents a sample, yes The centroid of
[0099] Analyze the output of the clustering algorithm to find different similar groups.
[0100] In the similarity analysis based on the dynamic feature change pattern, by clustering the dynamic features of different fresh products at different freshness stages, a product combination with similar dynamic behavior is identified. Specifically, for product X, its dynamic features change with freshness in the order of X1, X2, X3, and X4; the corresponding dynamic features of product Y change to Y1, Y2, Y3, and Y4; and the dynamic features of product Z change to Z1, Z2, Z3, and Z4. Based on these dynamic features, the cosine similarity is calculated. ,in, is the set of feature vectors for comparison, For the concentrated feature vectors;
[0101] When there is a significant similarity between the freshness stage X2 of product X and the freshness stage Y3 of product Y, similarly, the freshness stage Y4 of product Y and the freshness stage Z3 of product Z also show a high degree of similarity; based on this, products X, Y and Z are classified into the same similarity group, that is, they show consistent dynamic characteristic patterns at specific freshness change stages.
[0102] In step S3,
[0103] S31. Define the node type in the graph as product, set the basic attribute framework of each node, including: product ID, batch number, collection time, static features, dynamic features; define the edge type connecting the nodes as time series;
[0104] S32, import the obtained time series feature data of different fresh products, create a node for each batch of products at each time point, and assign corresponding attributes;
[0105] S33, creating edges between the associated time point product nodes, and assigning a weight to each edge;
[0106] Calculate the difference between feature vectors using Euclidean distance ,in, Is a node and In the feature dimension The value on , Refers to the nodes in the graph that represent fresh products from different batches or at different points in time; weights are assigned to edges in the dynamic spatiotemporal graph by quantifying the similarities or differences between product states at different points in time. , Is a constant that controls the decay rate of the weight.
[0107] The constructed dynamic spatiotemporal diagram should be able to intuitively display the trend of fresh products over time, as well as the commonalities and differences between different batches.
[0108] In step S4, the steps of self-learning mining model include:
[0109] Select a machine learning model and initialize model parameters; machine learning models include: neural network, support vector machine and decision tree;
[0110] Use the training data set to adjust the model parameters and minimize the loss function;
[0111] Mean squared error is used for regression tasks, and cross entropy loss is used for classification tasks;
[0112] Mean square error , cross entropy loss ; Is the real label and predicted values The residual between
[0113] The steps for training similar groups include:
[0114] For each similarity group, calculate the center point of the eigenvector of its internal members;
[0115] Similarity Group Include feature vector , the center point of the calculation group is , It is The feature vectors of similar groups;
[0116] Design a weight reduction function Reduce the individual feature vectors in similar groups Contribution during training; ; is the eigenvector With group center The distance between is a constant used to control the width of the weight reduction function;
[0117] During the training process, when calculating the loss function, the weight reduction function is applied to adjust the loss contribution of individual samples in similar groups. The modified loss function is: , It is The weight reduction factor of the sample;
[0118] In step S5, new nodes and edges are added, or the attributes of existing nodes and edges are updated to reflect the latest status of fresh products;
[0119] For new nodes and existing nodes , they belong to the same similar group, then the weights are adjusted according to the weight reduction function: ,in Is a node Weight reduction factor ; For new nodes and existing nodes Euclidean distance between eigenvectors; The new node Eigenvector of; similarity group The central point eigenvector of ; Is a constant used to control the width of the weight reduction function.
[0120] A data mining system based on self-learning, comprising:
[0121] Data acquisition module, used to obtain time series image data of different fresh products from different environments;
[0122] Data preprocessing module, used to preprocess the collected image data, including image denoising, enhancement and cropping, to ensure that all images have consistent resolution and format;
[0123] Feature extraction module, used to extract static features and dynamic features from the preprocessed image;
[0124] A cluster analysis module, used to perform cluster analysis based on the similarity of dynamic features, and regard fresh products with dynamic features of similar change patterns as a similar group;
[0125] Dynamic spatiotemporal graph construction module, used to construct dynamic spatiotemporal graphs of different batches of fresh products;
[0126] A self-learning mining module, which is used to input the extracted labels and product data of similar groups into the self-learning mining model and train it for similar groups;
[0127] The dynamic space-time graph updating module is used to continuously update the dynamic space-time graph with the results of self-learning mining data.
[0128] Application Supplementary Example:
[0129] We selected common fresh products: apples, bananas and oranges for actual testing. These products will show different static and dynamic characteristics at different stages of freshness. Through time series image data collection, feature extraction, cluster analysis, dynamic spatiotemporal graph construction and self-learning mining model training, we can accurately detect the freshness of these products.
[0130] Table 1 Freshness data table before update
[0131]
[0132] Before the spatiotemporal graph was updated, products with similar dynamic change patterns were divided into three different similarity groups: SG1, SG2, and SG3 according to the similarity of dynamic features. These three similarity groups correspond to the freshness levels of "fresh", "sub-fresh", and "rotten", respectively.
[0133] Assume that at time point T4, image data of new batches A2, B2, C2 of apples, bananas, and oranges are collected, and the corresponding static and dynamic features are extracted. After the self-learning mining model is trained and the dynamic spatiotemporal graph is updated, the following updated freshness data table is obtained;
[0134] Table 2 Freshness data table after the space-time graph is updated
[0135]
[0136] By comparing Table 1 and Table 2, it can be seen that the spatiotemporal graph successfully incorporates the data of the new batches A2, B2, and C2 after the update, and these data are correctly classified into the corresponding similarity groups and freshness levels.
[0137] The above is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and the technical scope must be determined according to the scope of the claims.
Claims
1. A data mining method based on self-learning, characterized in that: Includes steps: S1. Obtain time series image data of different fresh products and extract static and dynamic features of each product as labels; Define labels according to actual needs, including: freshness level, corruption degree and fresh variety classification; freshness level is divided into: fresh, sub-fresh and rotten; through the database, associate the extracted static features and dynamic features with the defined labels to form label data for subsequent analysis; S2. Based on the similarity of the dynamic features, cluster analysis is performed on the dynamic features, and the fresh products with dynamic features of similar change patterns are regarded as a similar group; S3. Build a dynamic spatiotemporal graph of fresh products from different batches, with products as nodes and time series as edges. By quantifying the similarities or differences between product states at different time points, weights are assigned to edges to show the trend of fresh products over time and the commonalities and differences between different batches. S4. Input the extracted labels and product data of similar groups into the constructed self-learning mining model, use the training data set to adjust the model parameters, minimize the loss function, train for similar groups, and achieve classification prediction of the freshness level of similar group products; the self-learning mining model adopts machine learning models, including: neural network, support vector machine and decision tree; S5. Based on the prediction or classification results of the fresh products output by the self-learning mining model, the similarity groups of the dynamic spatiotemporal graph are continuously updated; and the freshness of the fresh products is detected and identified using the updated similarity group information; In step S3, a dynamic spatiotemporal graph of different batches of fresh products is constructed, including: S31. Define the node type in the graph as product, set the basic attribute framework of each node, including: product ID, batch number, collection time, static features, dynamic features; define the edge type connecting the nodes as time series; S32, import the obtained time series feature data of different fresh products, create a node for each batch of products at each time point, and assign corresponding attributes; S33, creating edges between the associated time point product nodes, and assigning a weight to each edge; Calculate the difference between feature vectors using Euclidean distance Among them, x po ,x qo is the value of nodes p and q on the feature dimension o. p and q refer to the nodes in the graph that represent fresh products from different batches or at different time points. By quantifying the similarity or difference between product states at different time points, weights are assigned to edges in the dynamic spatiotemporal graph. σ is a constant that controls the decay rate of the weight.
2. The data mining method based on self-learning according to claim 1, characterized in that: In step S1, static features refer to features that are relatively stable throughout the life cycle of the fresh product and are not easily affected by external factors including time and lighting conditions, including: the inherent properties of the product's shape, color, and texture; Dynamic characteristics are those that change as the freshness of fresh products changes over time, including: the product's gloss, degree of decay, and smell.
3. The data mining method based on self-learning according to claim 1, characterized in that: The static feature extraction process is as follows: Shape feature extraction: Use Canny or Sobel edge detection algorithm to extract edge information in the image; Color feature extraction: Use the low-order moments of color to represent the color features of the image; convert the image to HSV or Lab color space, and calculate the mean, variance, and skewness of each color channel; the mean describes the center position of the color distribution, the variance describes the degree of dispersion of the color distribution, and the skewness describes the asymmetry of the color distribution; combine all the calculated low-order moment values to form a feature vector; Texture feature extraction: Divide the image into multiple small areas, compare the pixels in each area with the pixels in its neighborhood, generate binary codes based on the comparison results, and thus extract the texture features of the image.
4. The data mining method based on self-learning according to claim 1, characterized in that: The dynamic feature extraction process is as follows: Gloss feature extraction of products: Gloss features are extracted by analyzing the changes in the highlight area in the image: Decay degree feature extraction: Extract decay degree features by identifying the area and distribution of decayed areas in the image; Odor feature extraction: Indirect extraction through sensor data associated with time series image data.
5. The data mining method based on self-learning according to claim 1, characterized in that: In step S4, the steps of self-learning mining model include: Select a machine learning model and initialize model parameters; machine learning models include: neural network, support vector machine and decision tree; Use the training data set to adjust the model parameters and minimize the loss function; Mean squared error is used for regression tasks, and cross entropy loss is used for classification tasks; Mean square error Cross Entropy Loss is the true label y i and predicted values The residual between .
6. The data mining method based on self-learning according to claim 5, characterized in that: The steps for training similar groups include: For each similarity group, calculate the center point of the eigenvector of its internal members; The similarity group G contains v eigenvectors g1,g 2, …g v , the center point of the calculation group is g i is the feature vector of the ith similarity group; Design a weight reduction function w(g) to reduce the contribution of individual feature vectors g in similar groups during training; is the distance between the eigenvector g and the group center point g, σ is a constant used to control the width of the weight reduction function; During the training process, when calculating the loss function, the weight reduction function is applied to adjust the loss contribution of individual samples in similar groups. The modified loss function is: w(g i ) is the weight reduction factor of the i-th sample.
7. The data mining method based on self-learning according to claim 6, characterized in that: In step S5, new nodes and edges are added; For the new node M and the existing node N, assuming they belong to the same similarity group g, adjust the weight according to the weight reduction function: ω′ MN =ω MN ·ω M , where ω M is the weight reduction factor of node M; weight reduction factor W(M i ,c g ) is the Euclidean distance between the feature vectors of the new node M and the existing node N; M i is the feature vector of the new node M; the feature vector of the center point of the similarity group g is c g ; σ g Is a constant used to control the width of the weight reduction function.
8. A data mining system based on self-learning, based on a data mining method based on self-learning according to any one of claims 1 to 7, characterized in that: Included modules: Data acquisition module, used to obtain time series image data of different fresh products from different environments; Data preprocessing module, used to preprocess the collected image data, including image denoising, enhancement and cropping, to ensure that all images have consistent resolution and format; Feature extraction module, used to extract static features and dynamic features from the preprocessed image; A cluster analysis module, used to perform cluster analysis based on the similarity of dynamic features, and regard fresh products with dynamic features of similar change patterns as a similar group; Dynamic spatiotemporal graph construction module, used to construct dynamic spatiotemporal graphs of different batches of fresh products; A self-learning mining module, which is used to input the extracted labels and product data of similar groups into the self-learning mining model and train it for similar groups; The dynamic space-time graph updating module is used to continuously update the dynamic space-time graph with the results of self-learning mining data.
Citation Information
Patent Citations
Automated food freshness detection using feature deep learning
AU2020100953A4
Freshness-based smart store fresh product multi-strategy dynamic price adjustment method through electronic tag
CN107609893A