Kitchen waste component prediction method based on neural network
By combining the multimodal feature fusion and artifact recognition of images and near-infrared spectral data, the regression sub-model dynamically selects the problem of low efficiency and insufficient accuracy in kitchen waste composition analysis, and high-precision and real-time kitchen waste composition recognition are achieved.
Patent Information
- Application Number
- CN202510581896.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art relies on manual detection and laboratory instruments in the analysis of food waste ingredients, which are inefficient and susceptible to human interference. The neural network-based methods have low accuracy when facing interference with complex components and artifacts, and lack of model generalization capabilities, making it difficult to meet the real-time and accuracy requirements of intelligent waste treatment systems.
Using a neural network-based method, combining images and near-infrared spectral data, the liquid reflection, occlusion and edge blurred areas are detected through the artifact recognition subnet, a multimodal feature fusion model is constructed, and the regression sub-modal model is dynamically selected to achieve efficient and accurate identification of food waste ingredients.
It realizes high-precision and anti-interference recognition of kitchen waste ingredients, improves the robustness and stability of the model in complex environments, has real-time and engineering adaptability, and is suitable for intelligent waste disposal systems.
Smart Images

Figure CN120449123A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of garbage classification, and in particular to a method for predicting the composition of kitchen waste based on a neural network. Background Art
[0002] With the acceleration of urbanization and the continuous improvement of residents' living standards, the amount of food waste generated has increased year by year. Food waste is not only huge in quantity, but also has typical characteristics such as high water content, high organic matter content, and high oil content. Therefore, it faces great challenges in the collection, transportation, treatment and resource utilization. Especially in the context of the increasing promotion of intelligent waste disposal systems and waste classification policies, how to achieve rapid, accurate and intelligent identification and classification of the components of food waste has become a key technical link in promoting intelligent waste management.
[0003] Currently, the composition analysis of food waste mainly relies on manual detection and laboratory instrument analysis methods. Manual detection methods usually require staff to weigh, separate, dry and chemically analyze waste samples. This is not only labor-intensive and inefficient, but also easily interfered with by subjective factors of the operator, resulting in unstable analysis results. Laboratory instrument analysis often uses infrared spectrometers, moisture meters, thermogravimetric analyzers and other equipment to measure the composition. Although the accuracy is relatively high, it has strict requirements on equipment cost, sample preparation, detection cycle, operating environment, etc., and is not suitable for field environments or large-scale real-time deployment. In addition, some methods use image recognition or spectral feature extraction technology combined with traditional machine learning algorithms to predict the composition of garbage, but the model generalization ability is often poor, and it is difficult to adapt to the actual problems of complex composition, variable morphology and uneven sample distribution of food waste. It is prone to misjudgment, unclear classification, and untimely feedback, and cannot meet the high requirements of intelligent waste treatment systems for processing efficiency and real-time performance.
[0004] In recent years, with the development of artificial intelligence, particularly deep learning, neural networks have demonstrated remarkable capabilities in feature extraction and nonlinear modeling in areas such as image recognition, object detection, and multimodal fusion. Some research has attempted to apply convolutional neural networks, recurrent neural networks, and multilayer perceptrons to waste sorting and identification, achieving some progress. However, most currently available technologies focus on coarse-grained classification of waste categories, such as "recyclables," "kitchen waste," and "hazardous waste," while lacking in-depth modeling of the complex composition of food waste (such as protein, fat, water, cellulose, and carbohydrates). Composition-level analysis is not only crucial for optimizing waste disposal routes but also directly impacts the recovery efficiency of organic resources, the operational strategies of biological treatment equipment, and the economic viability of energy recovery.
[0005] In addition, existing neural network-based composition prediction methods usually ignore the problem of artifact interference in images. In actual shooting, food waste is often accompanied by factors such as liquid reflection, container occlusion, and blurred image edges. These artifact interferences will seriously affect the neural network's understanding and discrimination ability of garbage images. Existing research generally adopts direct image input or manually annotated masks, lacking a mechanism for automatic identification, modeling, and guided suppression of artifacts, resulting in a significant decrease in the accuracy of the model under strong interference conditions, poor stability, and insufficient generalization ability.
[0006] In terms of model structure design, most existing technologies use a general network structure and lack the adaptability optimization for the feature design of food waste. For example, when faced with garbage samples of different dominant component types (such as high-protein, high-moisture, high-fat, etc.), the network structure and training strategy do not make distinctions and ignore the differences in feature expression caused by sample heterogeneity, resulting in increased difficulty in model training, large prediction errors, and accuracy that is difficult to meet actual needs. At the same time, when processing component prediction outputs, traditional methods often use a single model for regression analysis, lack of refined diversion strategies, and fail to select a more suitable regression model for targeted optimization based on the dominant component category, further limiting the room for improvement in model performance. Summary of the Invention
[0007] One objective of the present invention is to propose a method for predicting the composition of food waste based on a neural network. The present invention integrates neural networks, multimodal feature fusion, and artifact modeling technology to construct a complete process from image and spectral acquisition, artifact recognition, dominant type discrimination to component regression prediction. This method achieves efficient, accurate, and interference-resistant identification of the complex components of food waste, and has the advantages of high prediction accuracy, strong environmental adaptability, and convenient deployment.
[0008] A method for predicting food waste composition based on a neural network according to an embodiment of the present invention includes the following steps:
[0009] S1, collect image data and near-infrared spectrum data of food waste samples, perform preprocessing, and generate feature vectors in a unified format;
[0010] S2. Input the preprocessed image data into the artifact recognition sub-network to detect liquid reflections, obstructions, and edge blur areas in the image data, generate artifact mask vectors, and mark the interference areas;
[0011] S3, inputting the feature vector and the artifact mask vector into a coarse classification neural network model to identify the dominant component type of the food waste sample under the guidance of interference region suppression;
[0012] S4. Based on the component-dominant type, select the corresponding regression sub-model from the pre-trained regression sub-model set, input the feature vector into the regression sub-model, and output the component prediction result of the food waste sample.
[0013] Optionally, the preprocessing of the image data includes image cropping, median filtering, normalization and standardization, and the preprocessing of the near-infrared spectral data includes missing band interpolation, normalization and standardization.
[0014] Optionally, the S2 specifically includes:
[0015] S21, constructing the preprocessed image data into a three-channel image tensor;
[0016] S22, inputting the three-channel image tensor into the artifact recognition sub-network;
[0017] S23. Perform pixel-by-pixel classification on the three-channel image tensor and output an artifact mask vector, where the artifact mask vector is a single-channel binary image, where a pixel value of 1 indicates an interference area, and a value of 0 indicates a non-interference area;
[0018] S24. Divide the interference area into three types of artifact areas, calculate the proportion of each type of artifact area in the entire image, and generate an artifact proportion vector:
[0019]
[0020] Among them, R i Represents the artifact ratio vector, which describes the proportion of the i-th type of artifact area in the entire image, N i represents the number of pixels in the i-th type artifact area, H represents the height of the image, and W represents the width of the image;
[0021] S25. Train the artifact recognition subnetwork based on the cross entropy loss function and optimize the parameters of the artifact recognition subnetwork:
[0022]
[0023] in, Represents the loss value, y i represents the true artifact label of the i-th pixel, p i represents the artifact prediction probability corresponding to the i-th pixel;
[0024] S26. Perform median filtering and edge smoothing on the artifact mask vector output by the optimized artifact recognition sub-network.
[0025] Optionally, the artifact recognition subnetwork is based on a U-Net network, including an encoder, a residual layer and a decoder, the encoder consists of four layers of convolution blocks, each convolution block includes two convolution layers and a maximum pooling layer, and the decoder includes an upsampling layer and a skip connection structure.
[0026] Optionally, the three types of artifact areas include liquid reflection areas, obstruction areas, and edge blur areas.
[0027] Optionally, the S3 specifically includes:
[0028] S31, obtaining an artifact proportion vector and an artifact mask vector from the artifact recognition sub-network;
[0029] S32: Construct a coarse classification neural network model, input the artifact proportion vector and the artifact mask vector into the coarse classification neural network model, and the coarse classification neural network model includes:
[0030] The main feature channel receives the feature vector and extracts the semantic expression vector through a two-layer fully connected network. It introduces a disturbance-aware residual mechanism based on artifact masking to adjust the response strength of the interference area in the feature propagation path to generate the main feature vector:
[0031] F1=F a +σ(Conv(M ′ ))⊙F a ;
[0032] Among them: F1 represents the main eigenvector, F a represents the semantic expression vector, σ represents the Sigmoid activation function, M ′ Denotes the artifact mask vector, Conv(M ′ ) represents the convolution operation performed on the artifact mask vector to generate the artifact perception response map, and ⊙ represents the corresponding element-by-element multiplication;
[0033] The mask channel inputs the artifact mask vector into the convolution encoder. Based on the dominant artifact type represented by the largest component in the artifact proportion vector, different convolution kernel parameters are dynamically selected to enhance the model's adaptability to different artifact interference patterns. The mask feature vector is output:
[0034] F2=Conv route(i*) (M ′ ),i * =arg max(R i );
[0035] Among them, F2 represents the mask feature vector, route(i * ) represents the dynamically selected convolution kernel parameters, i * Represents the index of the largest artifact type, Ri Represents the artifact ratio vector, argmax(R i ) represents the subscript with the largest value in the artifact proportion vector;
[0036] The proportion channel inputs the artifact proportion vector into a linear transformation network, and after weighted mapping and nonlinear activation function, outputs the auxiliary feature vector:
[0037] F3=ReLU(W r R i +b r );
[0038] Among them, F3 represents the auxiliary feature vector, W r represents the weight matrix of the linear transformation network, b r Represents the bias term of the linear transformation network, and ReLU represents the linear rectification activation function;
[0039] S33, performing feature concatenation on the vectors output by the three channels to construct a fused feature vector;
[0040] S34. Input the fused feature vector into two sub-classifiers connected in parallel, and perform independent dominant type classification judgment on each sub-classifier to obtain a classification probability vector:
[0041] P (1) =Softmax(W (1) F fused +b (1) ),P (2) =Softmax(W (2) F fused +b (2) );
[0042] Among them, P (1) and P (2) Represents the classification probability vector output by the two sub-classifiers, W (1) and W (2) represents the weight matrix of the corresponding classifier, b (1) and b (2) Represents the corresponding bias term, Softmax represents the standard normalized activation function, F fused represents the fused feature vector;
[0043] S35. Perform weighted integration on the results of the two sub-classifiers to generate a component-dominant type category:
[0044] C=argmax(αP (1) +(1-α)P (2) );
[0045] Among them, C represents the category of the dominant component type, α represents the integration coefficient, C represents the dominant component type category of the output, and argmax represents the category index corresponding to the maximum probability;
[0046] S36. During the model training phase, a weighted cross entropy loss function is used to adjust the category response weights based on the differences in sample artifact structures to improve the model's ability to discriminate against high-interference samples:
[0047]
[0048] in, Represents the total loss function value, e j represents the one-hot encoding of the true label, P j represents the predicted probability of the corresponding category, w j represents the category weighting factor;
[0049]
[0050] Among them, β represents the control coefficient, which controls the degree of influence of artifacts, and a j,i represents the sensitivity weight of artifact type i to category j, γ j represents the base weight of category j.
[0051] Optionally, the three types of artifact areas include liquid reflection areas, obstruction areas, and edge blur areas.
[0052] Optionally, the ingredient-dominant types include high-protein type, high-fat type, high-water type and high-carbohydrate type.
[0053] Optionally, the S4 specifically includes:
[0054] S41. Select a sub-model number based on the component-dominant type, and select a corresponding regression sub-model from the pre-trained regression sub-model set, including:
[0055] Convolutional network model, including 6 layers of convolutional structure:
[0056]
[0057] in, Represents the output of the l-th layer convolutional network model, Conv (l) Represents the l-th layer convolution operation, BN represents the batch normalization operation, ReLU represents the linear rectification activation function, Represents the feature output of the l-1 layer;
[0058] Channel Attention Perception Model:
[0059] F2=σ(ATT(GAP(F)));
[0060] Among them, F2 represents the output of the channel attention perception model, F represents the feature vector, GAP represents the global average pooling, ATT represents the attention network, and σ represents the Sigmoid activation function;
[0061] Multilayer Perceptron model;
[0062] The improved MLP-Mixer network introduces local convolution operations and embeds a channel attention mechanism:
[0063]
[0064] in, represents the output of the improved MLP-Mixer network at layer l, Represents the output of the improved MLP-Mixer network at layer l-1, Conv 3×3 Represents a 3×3 convolution operation, MLP (l) represents the perceptron of layer l, SE represents the Squeeze-and-Excitation layer;
[0065] S42. Input the eigenvector into the selected regression sub-model to obtain the component prediction value:
[0066]
[0067] in, represents the component prediction value, Indicates the predicted value of protein, Indicates the predicted value of fat, Indicates the predicted value of moisture, indicates the predicted value of cellulose, represents the predicted value of carbohydrates.
[0068] Optionally, the component prediction values include predicted values of protein, fat, water, cellulose and carbohydrates.
[0069] The beneficial effects of the present invention are:
[0070] First, the present invention proposes a neural network-based method for predicting the composition of food waste. This method proposes a systematic, deployable, and intelligent solution to the problems in the existing technology, such as the reliance on manual or instrumental detection methods, insufficient model prediction capabilities, poor structural adaptability, and the lack of artifact interference suppression mechanisms. This method integrates image information and near-infrared spectral data and adopts a multimodal feature construction method. On the basis of ensuring the integrity of the model input, it improves the ability to model the complex composition structure of food waste. Through image preprocessing and spectral data standardization, the system constructs a feature vector in a unified format, providing a high-quality input basis for subsequent artifact recognition and component discrimination.
[0071] Secondly, in terms of interference area modeling, the present invention introduces an artifact recognition sub-network to detect liquid reflections, occlusions and edge blur areas in the image, and converts the artifact results into artifact mask vectors and artifact proportion vectors as important interference information sources to guide subsequent classification and regression tasks. This mechanism significantly enhances the robustness and stability of the model in processing complex image interference scenarios, avoids the artifact influence being misidentified by the model as structural features, and effectively reduces the error propagation problem in component dominant type discrimination and component proportion prediction.
[0072] Again, the present invention further constructs a three-channel coarse classification neural network model, which structurally fuses three types of inputs: feature semantics, artifact mask and artifact proportion. The main feature channel effectively adjusts the response intensity of the interference area during the feature propagation process by introducing a disturbance-perceived residual mechanism. The mask channel dynamically selects different convolution kernel parameters according to the artifact proportion vector, which structurally improves the model's adaptability to different interference types. The proportion channel extracts the statistical features of the artifact distribution through linear mapping, providing auxiliary semantic supplements for discrimination. The three-channel structure works together to enable the model to maintain a high level of dominant type discrimination accuracy under complex image interference backgrounds.
[0073] In addition, the present invention designs a set of regression sub-models with diverse structures and targeted functions, and constructs dedicated regression networks for different dominant component types. In terms of structural design, it combines convolutional networks, channel attention models, multi-layer perceptrons and improved MLP-Mixer networks, so that each sub-model has the optimal representation and prediction capabilities under specific sample types. Among them, the improved MLP-Mixer network effectively compensates for the shortcomings of the standard MLP-Mixer in capturing local areas and feature channel weights by introducing local convolution operations and channel attention mechanisms, thereby improving the network's expressiveness in modeling unstructured image data.
[0074] Finally, the present invention also constructs a linkage mechanism from artifact recognition, dominant classification, sub-model selection to final component regression, realizing the closed-loop transmission of information between artifact perception and component structure modeling. By continuously utilizing artifact structure information throughout the entire prediction process, the system establishes an explicit semantic coordination mechanism between different model levels to avoid the problem of artifact influence failure or interference superposition in the prediction process, thereby achieving the effect of maintaining high-precision component recognition under strong interference, complex background, and component ambiguity. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0076] Figure 1 This is a flowchart of a method for predicting food waste composition based on a neural network proposed by the present invention;
[0077] Figure 2 This is a schematic diagram of the three-channel structure of a coarse classification neural network of a neural network-based method for predicting food waste composition proposed in the present invention;
[0078] Figure 3 This is a schematic diagram of the artifact mask generation and three-category artifact area division of the neural network-based food waste composition prediction method proposed in the present invention. DETAILED DESCRIPTION
[0079] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0080] refer to Figure 1-3 , a method for predicting food waste composition based on neural network, comprising the following steps:
[0081] S1, collect image data and near-infrared spectrum data of food waste samples, perform preprocessing, and generate feature vectors in a unified format;
[0082] S2. Input the preprocessed image data into the artifact recognition sub-network to detect liquid reflections, obstructions, and edge blur areas in the image data, generate artifact mask vectors, and mark the interference areas;
[0083] S3, inputting the feature vector and the artifact mask vector into a coarse classification neural network model to identify the dominant component type of the food waste sample under the guidance of interference region suppression;
[0084] S4. Based on the component-dominant type, select the corresponding regression sub-model from the pre-trained regression sub-model set, input the feature vector into the regression sub-model, and output the component prediction result of the food waste sample.
[0085] This paper constructs an end-to-end processing flow encompassing image and near-infrared spectral data acquisition, artifact detection, dominant type identification, and component regression prediction. By introducing an artifact perception mechanism and multimodal feature fusion, the system's robustness to image interference and its ability to model multi-source information are enhanced, effectively avoiding the prediction errors caused by artifact interference, information loss, or single-mode input in traditional methods. The overall process can be deployed in actual waste treatment systems to achieve online prediction. It has the advantages of strong real-time performance, high prediction accuracy, and strong engineering adaptability, making it suitable for intelligent waste treatment applications in complex environments.
[0086] In this embodiment, the preprocessing of image data includes image cropping, median filtering, normalization and standardization, and the preprocessing of near-infrared spectral data includes missing band interpolation, normalization and standardization.
[0087] This method effectively improves the quality and consistency of raw data through meticulous image and near-infrared spectral data preprocessing. Image data is processed through cropping, median filtering, normalization, and standardization to reduce background interference and imaging noise. Spectral data is processed through missing band interpolation and standardization to enhance the continuity and feature stability of spectral dimensions. This processing provides cleaner, more structured input for the neural network model, facilitating improved accuracy in subsequent feature extraction, classification, and regression tasks, ensuring model learning efficiency and overall performance stability from the source.
[0088] In this embodiment, S2 specifically includes:
[0089] S21, constructing the preprocessed image data into a three-channel image tensor;
[0090] S22, inputting the three-channel image tensor into the artifact recognition sub-network;
[0091] S23. Perform pixel-by-pixel classification on the three-channel image tensor and output an artifact mask vector, where the artifact mask vector is a single-channel binary image, where a pixel value of 1 indicates an interference area, and a value of 0 indicates a non-interference area;
[0092] S24. Divide the interference area into three types of artifact areas, calculate the proportion of each type of artifact area in the entire image, and generate an artifact proportion vector:
[0093]
[0094] Among them, R iRepresents the artifact ratio vector, which describes the proportion of the i-th type of artifact area in the entire image, N i represents the number of pixels in the i-th type artifact area, H represents the height of the image, and W represents the width of the image;
[0095] S25. Train the artifact recognition subnetwork based on the cross entropy loss function and optimize the parameters of the artifact recognition subnetwork:
[0096]
[0097] in, Represents the loss value, y i represents the true artifact label of the i-th pixel, p i represents the artifact prediction probability corresponding to the i-th pixel;
[0098] S26. Perform median filtering and edge smoothing on the artifact mask vector output by the optimized artifact recognition sub-network.
[0099] In the artifact recognition stage, the present invention realizes automatic detection and quantitative modeling of interference areas in the image by constructing image tensors, performing pixel-by-pixel artifact classification, and outputting artifact masks and artifact proportion vectors. Compared with the traditional method that relies on manual labeling or static masking, this method has high automation and dynamic perception capabilities, can accurately identify artifacts such as liquid reflections, obstructions and edge blur, reduce the impact of image interference on model judgment, enhance the adaptability of the overall system to complex image environments, and improve the robustness and reliability of classification and regression prediction.
[0100] In this embodiment, the artifact recognition subnetwork is based on the U-Net network, including an encoder, a residual layer and a decoder. The encoder consists of four layers of convolution blocks, each convolution block includes two convolution layers and a maximum pooling layer, and the decoder includes an upsampling layer and a skip connection structure.
[0101] The present invention adopts an improved network structure based on U-Net in the artifact recognition subnetwork, combined with a residual module, an encoder and a decoder to achieve high-resolution recognition of multi-scale artifact areas. Each convolution block contains two convolution layers and a maximum pooling operation, which can extract the feature semantic information of the artifact area at different spatial scales. The decoder restores image details through upsampling and jump connections, retaining spatial position information. The overall structure has excellent boundary perception ability and fine-grained segmentation effect, which improves the detection accuracy of local interference areas and ensures the stability and practicality of the artifact mask output.
[0102] In this embodiment, the three types of artifact areas include liquid reflection areas, obstruction areas, and edge fuzzy areas.
[0103] The present invention classifies artifact regions into three categories: liquid reflections, obstructions, and edge blur. During the artifact recognition process, the proportion of each type of artifact region in the entire image is simultaneously output, forming an artifact proportion vector. This structure not only provides the spatial location of artifacts but also their quantitative distribution characteristics, enabling the system to quantitatively understand the degree of interference and implement dynamic structural adaptation and response adjustment in subsequent models. This mechanism enhances the network's interpretability and anti-interference modeling capabilities for different types of interference images, effectively improving the model's prediction accuracy and generalization capabilities for complex samples.
[0104] In this embodiment, S3 specifically includes:
[0105] S31, obtaining an artifact proportion vector and an artifact mask vector from the artifact recognition sub-network;
[0106] S32: Construct a coarse classification neural network model, input the artifact proportion vector and the artifact mask vector into the coarse classification neural network model, and the coarse classification neural network model includes:
[0107] The main feature channel receives the feature vector and extracts the semantic expression vector through a two-layer fully connected network. It introduces a disturbance-aware residual mechanism based on artifact masking to adjust the response strength of the interference area in the feature propagation path to generate the main feature vector:
[0108] F1=F a +σ(Conv(M ′ ))⊙F a ;
[0109] Among them: F1 represents the main eigenvector, F a represents the semantic expression vector, σ represents the Sigmoid activation function, M ′ Denotes the artifact mask vector, Conv(M ′ ) represents the convolution operation performed on the artifact mask vector to generate the artifact perception response map, and ⊙ represents the corresponding element-by-element multiplication;
[0110] The mask channel inputs the artifact mask vector into the convolution encoder. Based on the dominant artifact type represented by the largest component in the artifact proportion vector, different convolution kernel parameters are dynamically selected to enhance the model's adaptability to different artifact interference patterns. The mask feature vector is output:
[0111]
[0112] Among them, F2 represents the mask feature vector, route(i * ) represents the dynamically selected convolution kernel parameters, i * Represents the index of the largest artifact type, R i Represents the artifact ratio vector, argmax(Ri ) represents the subscript with the largest value in the artifact proportion vector;
[0113] The proportion channel inputs the artifact proportion vector into a linear transformation network, and after weighted mapping and nonlinear activation function, outputs the auxiliary feature vector:
[0114] F3=ReLU(W r R i +b r );
[0115] Among them, F3 represents the auxiliary feature vector, W r represents the weight matrix of the linear transformation network, b r Represents the bias term of the linear transformation network, and ReLU represents the linear rectification activation function;
[0116] S33, performing feature concatenation on the vectors output by the three channels to construct a fused feature vector;
[0117] S34. Input the fused feature vector into two sub-classifiers connected in parallel, and perform independent dominant type classification judgment on each sub-classifier to obtain a classification probability vector:
[0118] P (1) =Softmax(W (1) F fused +b (1) ),P (2) =Softmax(W (2) F fused +b (2) );
[0119] Among them, P (1) and P (2) Represents the classification probability vector output by the two sub-classifiers, W (1) and W (2) represents the weight matrix of the corresponding classifier, b (1) and b (2) Represents the corresponding bias term, Softmax represents the standard normalized activation function, F fused represents the fused feature vector;
[0120] S35. Perform weighted integration on the results of the two sub-classifiers to generate a component-dominant type category:
[0121] C=argmax(αP (1) +(1-α)P (2) );
[0122] Among them, C represents the category of the dominant component type, α represents the integration coefficient, C represents the dominant component type category of the output, and argmax represents the category index corresponding to the maximum probability;
[0123] S36. During the model training phase, a weighted cross entropy loss function is used to adjust the category response weights based on the differences in sample artifact structures to improve the model's ability to discriminate against high-interference samples:
[0124]
[0125] in, Represents the total loss function value, e j represents the one-hot encoding of the true label, P j represents the predicted probability of the corresponding category, w j represents the category weighting factor;
[0126]
[0127] Among them, β represents the control coefficient, which controls the degree of influence of artifacts, and a j,i represents the sensitivity weight of artifact type i to category j, γ j represents the base weight of category j.
[0128] The present invention introduces a three-way structure of main feature channel, mask channel and proportion channel into the coarse classification neural network, and collaboratively models image features, artifact masks and artifact proportion information. Through the disturbance perception residual mechanism and dynamic convolution selection, the network can adaptively perceive the influence of artifacts in the image and adjust the feature response intensity of different areas. The parallel sub-classifier and integration mechanism improves the stability of the dominant component type judgment. This structure realizes the deep fusion of artifact information and classification decision, and significantly improves the system's component dominant type recognition accuracy and classification robustness under complex interference backgrounds.
[0129] In this embodiment, the three types of artifact areas include liquid reflection areas, obstruction areas, and edge fuzzy areas.
[0130] The present invention clearly defines the types of artifacts into three categories: liquid reflections, obstructions, and edge blur, unifies the classification targets and output structures of the artifact recognition sub-network, and makes model training more targeted. By encoding, identifying, and modeling the three types of artifacts separately, the system can achieve fine control of artifact levels and interference classification processing, thereby improving the network's resolution ability when dealing with highly complex image data. At the same time, the artifact classification standard also provides support for differentiated processing strategies for various types of artifacts in subsequent networks, thereby improving the overall processing capability and environmental adaptability of the system.
[0131] In this embodiment, the dominant ingredient types include high-protein type, high-fat type, high-water type and high-carbohydrate type.
[0132] The present invention subdivides the dominant types of food waste components into high-protein, high-fat, high-moisture and high-carbohydrate types, and sets different model processing paths accordingly. This classification method fits the natural physical and chemical properties of food waste, which helps the model to express features and select structures more specifically during training and inference, effectively improving the matching degree and prediction accuracy of the regression model. At the same time, the dominant type classification results can also directly provide a basis for subsequent waste treatment path decisions, with good system integration and engineering implementation value.
[0133] In this embodiment, the S4 specifically includes:
[0134] S41. Select a sub-model number based on the component-dominant type, and select a corresponding regression sub-model from the pre-trained regression sub-model set, including:
[0135] Convolutional network model, including 6 layers of convolutional structure:
[0136]
[0137] in, Represents the output of the l-th layer convolutional network model, Conv (l) Represents the l-th layer convolution operation, BN represents the batch normalization operation, ReLU represents the linear rectification activation function, Represents the feature output of the l-1 layer;
[0138] Channel Attention Perception Model:
[0139] F2=σ(ATT(GAP(F)));
[0140] Among them, F2 represents the output of the channel attention perception model, F represents the feature vector, GAP represents the global average pooling, ATT represents the attention network, and σ represents the Sigmoid activation function;
[0141] Multilayer Perceptron model;
[0142] The improved MLP-Mixer network introduces local convolution operations and embeds a channel attention mechanism:
[0143]
[0144] in, represents the output of the improved MLP-Mixer network at layer l, Represents the output of the improved MLP-Mixer network at layer l-1, Conv 3×3 Represents a 3×3 convolution operation, MLP (l)represents the perceptron of layer l, SE represents the Squeeze-and-Excitation layer;
[0145] S42. Input the eigenvector into the selected regression sub-model to obtain the component prediction value:
[0146]
[0147] in, represents the component prediction value, Indicates the predicted value of protein, Indicates the predicted value of fat, Indicates the predicted value of moisture, indicates the predicted value of cellulose, represents the predicted value of carbohydrates.
[0148] In the design of the regression sub-model structure, the present invention constructs a model set including convolutional networks, channel attention models, MLPs and improved MLP-Mixer. The optimal model is dynamically selected based on the dominant type prediction results, thereby improving the prediction targeting and regression accuracy. Each type of model structure is independently trained and fine-tuned under specific sample characteristics, which can effectively capture the characteristic distribution patterns of different types of samples and improve the system's ability to model component structures. The model differentiation deployment strategy enhances the interpretability and scalability of the entire system, reduces the risk of model error propagation, and has stronger engineering practicality.
[0149] In this embodiment, the component prediction values include the prediction values of protein, fat, water, cellulose and carbohydrates.
[0150] Example 1:
[0151] In order to verify the feasibility of the present invention in implementation, the present invention was applied to the food waste treatment process of a city domestic waste sorting center in Jiangsu Province. The center processes about 120 tons of residential domestic waste every day, of which food waste accounts for more than 35%. In the traditional operation process, the identification of food waste components mainly relies on weighing and laboratory sampling analysis. The average cycle from sample collection to obtaining component results is about 6 hours, and at least 2 professional testers and a set of spectral analysis equipment worth nearly 200,000 yuan are required. Data feedback delays, heavy labor pressure for testing, and serious lack of real-time and dynamic processing capabilities have become one of the main bottlenecks restricting the improvement of the center's waste sorting and processing capabilities.
[0152] To address this issue, this example utilizes the neural network-based food waste composition prediction method proposed in this paper and integrates it into an intelligent analysis module on one of the center's automated sorting lines. The system is equipped with an RGB camera and a near-infrared spectral sensor, which acquire image and spectral data, respectively. On average, a garbage sample image frame and corresponding spectral curve are collected every three seconds. This data is then transmitted in real time to a backend analysis module for preprocessing, artifact detection, dominant type identification, and composition regression prediction.
[0153] Specifically, after the data enters the system, the image and spectral data are first preprocessed. The image data is constructed into a three-channel image tensor after median filtering and normalization. The spectral data is normalized after filling in the missing bands and fused into a feature vector. The system automatically identifies whether there are liquid reflections, obstructions or blurred areas at the edges of the image, and generates a single-channel artifact mask map and three types of artifact proportion vectors for subsequent disturbance perception mechanism and dynamic structure selection. Subsequently, the fused feature vector and artifact information are input into the coarse classification neural network. The system automatically determines the dominant component type of the garbage sample, and selects the model with the most suitable structure in the regression sub-model set based on the discrimination results to perform regression calculations.
[0154] Table 1 Comparison of component prediction capability and processing efficiency before and after system deployment
[0155]
[0156] In terms of processing capacity, the system has achieved a significant increase in the average daily number of processed samples from 200 supported by traditional manual or laboratory equipment to 3,200, an increase of up to 16 times, effectively supporting high-frequency on-site waste disposal tasks and fully meeting the actual demand for high throughput in large-scale food waste circulation scenarios.
[0157] In terms of response time, the traditional detection model takes an average of about 6 hours for each sample analysis cycle. However, this system is based on an end-to-end neural network architecture and combines image and near-infrared spectral data processing. The overall prediction time is only 6 seconds, which is 3,600 times faster than before. This makes real-time component perception possible and provides timely parameter support for subsequent garbage sorting and processing, greatly reducing waiting and delay costs.
[0158] In terms of component prediction accuracy, the system controls the average error rate of the five main components (protein, fat, water, cellulose, and carbohydrates) within 4.7%, fully meeting the actual use requirements at the engineering level. Among them, in high-fat food waste samples, the prediction error of fat components is as low as 1.2%, indicating that the system is not only suitable for general scenarios, but can also provide highly accurate recognition capabilities for samples enriched in specific components.
[0159] In terms of dealing with image interference, this system combines the artifact recognition sub-network with the mask feedback mechanism, and has good adaptability to complex interference environments such as liquid reflections, obstructions and blurred edges. After testing, in typical high-artifact sample scenarios, the system's classification accuracy increased from 81.3% before processing to 92.7%, an increase of more than 11%, significantly improving the robustness and stability of the system in practical applications.
[0160] In addition, by comparing the system output results with manual sampling detection data, statistics show that the misclassification rate has been reduced by more than 50%, indicating that this method has significant advantages in reducing the risk of misclassification. In subsequent processes, such as oil separation and fermentation, the energy efficiency of processes has been improved by about 12.1%, and the overall energy consumption has been reduced by 9.3%. This not only improves the processing efficiency, but also effectively controls the operating costs, and has good economy and environmental friendliness.
[0161] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for predicting food waste composition based on neural network, characterized in that: The steps include: S1, collect image data and near-infrared spectrum data of food waste samples, perform preprocessing, and generate feature vectors in a unified format; S2. Input the preprocessed image data into the artifact recognition sub-network to detect liquid reflections, obstructions, and edge blur areas in the image data, generate artifact mask vectors, and mark the interference areas; S3, inputting the feature vector and the artifact mask vector into a coarse classification neural network model to identify the dominant component type of the food waste sample under the guidance of interference region suppression; S4. Based on the component-dominant type, select the corresponding regression sub-model from the pre-trained regression sub-model set, input the feature vector into the regression sub-model, and output the component prediction result of the food waste sample.
2. The method for predicting food waste composition based on a neural network according to claim 1, characterized in that: The preprocessing of image data includes image cropping, median filtering, normalization and standardization, and the preprocessing of near-infrared spectral data includes missing band interpolation, normalization and standardization.
3. The method for predicting food waste composition based on a neural network according to claim 1, characterized in that: The S2 specifically includes: S21, constructing the preprocessed image data into a three-channel image tensor; S22, inputting the three-channel image tensor into the artifact recognition sub-network; S23. Perform pixel-by-pixel classification on the three-channel image tensor and output an artifact mask vector, where the artifact mask vector is a single-channel binary image, where a pixel value of 1 indicates an interference area, and a value of 0 indicates a non-interference area; S24, dividing the interference area into three types of artifact areas, and calculating the proportion of each type of artifact area in the entire image to generate an artifact proportion vector; S25. Training the artifact recognition subnetwork based on the cross entropy loss function to optimize the parameters of the artifact recognition subnetwork; S26. Perform median filtering and edge smoothing on the artifact mask vector output by the optimized artifact recognition sub-network.
4. The method for predicting food waste composition based on a neural network according to claim 3, characterized in that: The artifact recognition subnetwork is based on the U-Net network, including an encoder, a residual layer and a decoder. The encoder consists of four layers of convolution blocks, each of which includes two convolution layers and a maximum pooling layer. The decoder includes an upsampling layer and a skip connection structure.
5. The method for predicting food waste composition based on a neural network according to claim 3, characterized in that: The three types of artifact areas include liquid reflection areas, obstruction areas, and edge blur areas.
6. The method for predicting food waste composition based on a neural network according to claim 1, characterized in that: The S3 specifically includes: S31, obtaining an artifact proportion vector and an artifact mask vector from the artifact recognition sub-network; S32: Construct a coarse classification neural network model, input the artifact proportion vector and the artifact mask vector into the coarse classification neural network model, and the coarse classification neural network model includes: The main feature channel receives the feature vector and extracts the semantic expression vector through a two-layer fully connected network. It introduces a disturbance-aware residual mechanism based on artifact masking to adjust the response strength of the interference area in the feature propagation path to generate the main feature vector: F1=F a +σ(Conv(M ′ ))⊙F a ; Among them: F1 represents the main eigenvector, F a represents the semantic expression vector, σ represents the Sigmoid activation function, M ′ Denotes the artifact mask vector, Conv(M ′ ) represents the convolution operation performed on the artifact mask vector to generate the artifact perception response map, and ⊙ represents the corresponding element-by-element multiplication; The mask channel inputs the artifact mask vector into the convolution encoder, dynamically selects different convolution kernel parameters based on the dominant artifact type represented by the largest component in the artifact proportion vector, and outputs the mask feature vector; The proportion channel inputs the artifact proportion vector into a linear transformation network, and after weighted mapping and nonlinear activation function, outputs the auxiliary feature vector; S33, performing feature concatenation on the vectors output by the three channels to construct a fused feature vector; S34, inputting the fused feature vector into two sub-classifiers connected in parallel, performing independent dominant type classification judgment on each sub-classifier, and obtaining a classification probability vector; S35, performing weighted integration on the results of the two sub-classifiers to generate a category of component-dominant type; S36. During the model training phase, a weighted cross entropy loss function is used to adjust the category response weights based on the differences in sample artifact structures: in, Represents the total loss function value, e j represents the one-hot encoding of the true label, P j represents the predicted probability of the corresponding category, w j represents the category weighting factor; Among them, β represents the control coefficient, which controls the degree of influence of artifacts, and a j,i represents the sensitivity weight of artifact type i to category j, γ j represents the base weight of category j.
7. The method for predicting food waste composition based on a neural network according to claim 6, characterized in that: The three types of artifact areas include liquid reflection areas, obstruction areas, and edge blur areas.
8. The method for predicting food waste composition based on a neural network according to claim 6, characterized in that: The dominant ingredient types include high-protein type, high-fat type, high-water type and high-carbohydrate type.
9. The method for predicting food waste composition based on a neural network according to claim 1, characterized in that: The S4 specifically includes: S41. Select a sub-model number based on the component-dominant type, and select a corresponding regression sub-model from the pre-trained regression sub-model set, including: Convolutional network model, including 6-layer convolution structure; Channel attention perception model; Multilayer Perceptron model; The improved MLP-Mixer network introduces local convolution operations and embeds a channel attention mechanism: in, represents the output of the improved MLP-Mixer network at layer l, Represents the output of the improved MLP-Mixer network at layer l-1, Conv 3×3 Represents a 3×3 convolution operation, MLP (l) represents the perceptron of layer l, SE represents the Squeeze-and-Excitation layer; S42. Input the feature vector into the selected regression sub-model to obtain component prediction values.
10. The method for predicting food waste composition based on neural network according to claim 9, characterized in that: The component prediction values include the prediction values of protein, fat, water, cellulose and carbohydrates.