Method for training and applying a combined microplastic type and aging degree recognition model and related apparatus
By combining hyperspectral imaging with a multi-task deep learning model, the problem of efficiently identifying microplastic types and aging levels is solved, simplifying sample pretreatment and improving identification efficiency and accuracy. It is suitable for identifying tiny particles in complex backgrounds.
Patent Information
- Application Number
- CN202511130811.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-08-13
AI Technical Summary
Existing detection technologies are difficult to achieve efficient and automated identification of microplastic types and aging levels, and rely on complex sample pretreatment processes, resulting in low identification efficiency and long cycles.
By combining hyperspectral imaging technology with a multi-task deep learning model, a deep learning model is constructed to jointly identify the type and degree of aging of microplastics by acquiring hyperspectral images of microplastic samples, extracting spectral feature vectors of sample pixels, and building a deep learning model.
It enables efficient and accurate identification of microplastic types and aging levels, simplifies sample pretreatment procedures, and improves identification efficiency and accuracy. It is suitable for the identification and analysis of tiny particles in complex backgrounds.
Smart Images

Figure CN121033510B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microplastic identification technology, and in particular to a method and related apparatus for training and applying a joint identification model of microplastic type and aging degree. Background Technology
[0002] With the widespread use of plastic products in production and daily life, a large amount of waste plastic gradually breaks down and degrades in the environment, forming microplastics (MPs) with a particle size of less than 5 mm. Microplastics are widely detected in water, soil, and the atmosphere. Microplastics exposed to the environment typically undergo aging under the long-term effects of factors such as ultraviolet radiation, moisture, and temperature, leading to changes in their surface structure and chemical properties. This, in turn, enhances their ability to adsorb harmful pollutants and release additives, significantly increasing their ecotoxicity and environmental risks. Therefore, achieving simultaneous identification of microplastic types and their aging levels is not only crucial for pollution source tracing and classification management but also a key prerequisite for assessing their environmental behavior and potential hazards.
[0003] However, existing detection technologies mainly include Fourier transform infrared spectroscopy (FTIR), Raman spectroscopy, and scanning electron microscopy (SEM). Although they can achieve high-precision identification of microplastic types, they usually rely on complex sample pretreatment processes, have long testing cycles, low throughput, and only focus on high-precision identification of microplastic types, lacking the ability to automatically identify the degree of aging of microplastics. Summary of the Invention
[0004] The purpose of this application is to provide a training and application method and related device for a joint identification model of microplastic type and aging degree, which can realize the joint identification of microplastic type and microplastic aging degree, and improve the identification efficiency and accuracy.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides a method for training a joint identification model of microplastic type and aging degree, the method comprising:
[0007] Acquire hyperspectral images and sample labels for each of multiple microplastic samples; the sample labels include the microplastic type and the degree of microplastic aging.
[0008] For each of the sample hyperspectral images, extract the sample spectral feature vector of each sample pixel in the sample hyperspectral image, and set the sample label corresponding to the sample hyperspectral image as the sample label of each sample pixel in the sample hyperspectral image to construct a dataset; the dataset includes the sample spectral feature vector and sample label of each sample pixel;
[0009] Build deep learning models;
[0010] Using the sample spectral feature vector of the sample pixel as input and the sample label of the sample pixel as label, the deep learning model is trained using the dataset to obtain a joint identification model for microplastic type and aging degree.
[0011] Optionally, the sample spectral feature vector of each sample pixel in the sample hyperspectral image is extracted, and the sample label corresponding to the sample hyperspectral image is set as the sample label of each sample pixel in the sample hyperspectral image to construct a dataset, specifically including:
[0012] The hyperspectral image of the sample is cropped to obtain the cropped hyperspectral image of the sample corresponding to the ROI region in the microplastic sample; the ROI region is the region where the microplastic is located.
[0013] Extract the sample spectral feature vector of each sample pixel in the cropped sample hyperspectral image, and set the sample label corresponding to the cropped sample hyperspectral image as the sample label of each sample pixel in the cropped sample hyperspectral image to construct a dataset.
[0014] Optionally, the sample spectral feature vector of each sample pixel in the cropped sample hyperspectral image is extracted, specifically including:
[0015] For each sample pixel in the cropped hyperspectral image, the spectral information of the sample pixel is extracted to obtain the initial sample spectral feature vector of the sample pixel; the initial sample spectral feature vector is filtered using the SG filtering algorithm to obtain the filtered sample spectral feature vector of the sample pixel; the filtered sample spectral feature vector is normalized using the SNV normalization algorithm to obtain the sample spectral feature vector of the sample pixel.
[0016] Optionally, the deep learning model includes: a shared feature extraction branch, a type recognition branch, and an aging degree recognition branch, wherein the output of the shared feature extraction branch is connected to the input of the type recognition branch and the first input of the aging degree recognition branch, and the first output of the type recognition branch is connected to the second input of the aging degree recognition branch.
[0017] The shared feature extraction branch is used to extract features from the spectral feature vector to obtain shared features;
[0018] The type identification branch is used to determine the probability of each microplastic type based on the shared features, and to determine the identification result of the microplastic type based on the probability of each microplastic type;
[0019] The aging degree identification branch is used to determine the probability of each microplastic aging degree based on the shared features and the probability of each microplastic type, and to determine the identification result of the microplastic aging degree based on the probability of each microplastic aging degree.
[0020] Optionally, the shared feature extraction branch includes a convolutional module, several residual modules, and an attention mechanism module connected in sequence;
[0021] The convolutional module includes a first convolutional layer, a first batch of normalized layers, and a first max pooling layer connected in sequence.
[0022] The residual module includes a second convolutional layer, a second batch normalization layer, a third convolutional layer, a third batch normalization layer, a fourth convolutional layer, a first addition layer, a second max pooling layer, a fifth convolutional layer, a fourth batch normalization layer, a sixth convolutional layer, a fifth batch normalization layer, a seventh convolutional layer, and a second addition layer connected in sequence. The input terminals of the second convolutional layer, the first addition layer, and the second addition layer of the first residual module are all connected to the output terminal of the first max pooling layer.
[0023] The attention mechanism module is a channel attention mechanism module, which includes a first global average pooling layer, a first fully connected layer, a second fully connected layer, a reshape layer, a first multiplication layer, and a second global average pooling layer connected in sequence. The input of the first global average pooling layer and the input of the first multiplication layer are both connected to the output of the second addition layer of the last residual module. The output of the second global average pooling layer is the output of the shared feature extraction branch.
[0024] The type recognition branch includes a third fully connected layer and a first Dropout layer connected in sequence. The input of the third fully connected layer is the input of the type recognition branch, and the output of the third fully connected layer is the first output of the type recognition branch.
[0025] The aging degree identification branch includes a gated unit layer, a second multiplication layer, a splicing layer, a fourth fully connected layer, a second Dropout layer, and a fifth fully connected layer connected in sequence. The input terminals of the gated unit layer and the second multiplication layer are both the second input terminals of the aging degree identification branch, and the input terminal of the splicing layer is the first input terminal of the aging degree identification branch.
[0026] Optionally, using the sample spectral feature vector of the sample pixels as input and the sample label of the sample pixels as label, the deep learning model is trained using the dataset to obtain a joint identification model for microplastic type and aging degree, specifically including:
[0027] The dataset is divided into a training set and a test set;
[0028] Using the sample spectral feature vectors of sample pixels in the training set as input and the sample labels of sample pixels in the training set as labels, the deep learning model is trained using the training set to obtain a joint identification model for microplastic type and aging degree.
[0029] The joint identification model of microplastic type and aging degree is tested using the test set to obtain the performance of the joint identification model of microplastic type and aging degree; wherein, the performance is characterized by performance evaluation indicators, including accuracy, precision, recall, F1 score and confusion matrix.
[0030] Optionally, the deep learning model is trained using the training set to obtain a joint identification model for microplastic type and aging degree. Specifically, this includes: training the deep learning model using 5-fold cross-validation based on the training set to obtain the joint identification model for microplastic type and aging degree; wherein, during the training process of the deep learning model, the Adam optimizer, early stopping mechanism training strategy, learning rate decay training strategy, and uncertainty-weighted loss function are used. The uncertainty-weighted loss function is a weighted sum of the loss functions of the type identification branch and the aging degree identification branch in the deep learning model, and both the loss functions of the type identification branch and the aging degree identification branch use the cross-entropy loss function.
[0031] Secondly, this application provides a method for applying a joint identification model of microplastic type and aging degree, the method comprising:
[0032] Acquire hyperspectral images of the microplastic sample to be tested;
[0033] Extract the spectral feature vector of each pixel in the hyperspectral image;
[0034] For each pixel, the spectral feature vector of the pixel is used as input, and the microplastic type and aging degree of the pixel are determined by the joint identification model of microplastic type and aging degree, thus completing the joint identification of microplastic type and aging degree of the microplastic sample to be tested; wherein, the joint identification model of microplastic type and aging degree is a model trained by the above-mentioned joint identification model training method of microplastic type and aging degree.
[0035] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the above-described training method for the joint identification model of microplastic type and aging degree or the above-described application method for the joint identification model of microplastic type and aging degree.
[0036] Fourthly, this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described training method for the joint identification model of microplastic type and aging degree or the above-described application method for the joint identification model of microplastic type and aging degree.
[0037] According to the specific embodiments provided in this application, this application has the following technical effects:
[0038] This application provides a method and related apparatus for training and applying a joint identification model of microplastic type and aging degree. The method involves acquiring a hyperspectral image and a label for each microplastic sample from multiple microplastic samples. The label includes the microplastic type and the degree of microplastic aging. For each hyperspectral image, the method extracts the spectral feature vector of each pixel in the hyperspectral image and sets the corresponding label as the label for each pixel. A dataset is constructed, including the spectral feature vector and label for each pixel. A deep learning model is then built, using the spectral feature vector as input and the label as output. Using labels as tags, a deep learning model is trained on a dataset to obtain a joint identification model for microplastic type and aging degree. This application uses the sample spectral feature vector and sample label of each sample pixel in the sample hyperspectral image to train the deep learning model and obtain a joint identification model for microplastic type and aging degree. Subsequently, the spectral feature vector of each pixel in the hyperspectral image is directly used as input to achieve joint identification of microplastic type and microplastic aging degree using the joint identification model for microplastic type and aging degree. Moreover, it only requires the acquisition of hyperspectral images and does not rely on complex sample preprocessing procedures. The test cycle is short, the throughput is high, and the identification efficiency can be improved. At the same time, the introduction of a deep learning model can improve the identification accuracy. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This diagram illustrates the application environment for the training and application method of the joint identification model of microplastic type and aging degree provided in this application.
[0041] Figure 2 This is a flowchart illustrating a training method for a joint identification model of microplastic type and aging degree provided in Embodiment 1 of this application.
[0042] Figure 3 This is a flowchart illustrating a method for jointly identifying microplastic type and aging degree according to Embodiment 1 of this application; wherein, Figure 3 (a) in the text refers to the construction of the dataset. Figure 3 (b) in the diagram represents model construction. Figure 3 (c) in the text refers to model evaluation and application.
[0043] Figure 4This is a schematic diagram illustrating the evaluation of a joint identification model for microplastic type and aging degree provided in Embodiment 1 of this application; wherein, Figure 4 In the diagram, (a) shows the loss curves for training and validation. Figure 4 (b) in the figure shows the accuracy curves for training and validation. Figure 4 In the matrix, (c) represents the confusion matrix for type classification. Figure 4 In the matrix, (d) represents the confusion matrix for classifying aging levels. Figure 4 (e) in the figure represents a comparison of comprehensive performance indicators based on type classification and aging degree classification. Figure 4 In the equation (f), F1 scores represent different classification types.
[0044] Figure 5 This is a schematic diagram illustrating the application of a joint identification model for microplastic type and aging degree provided in Embodiment 1 of this application; wherein, Figure 5 (a) in the text represents representative plastic products used in daily life. Figure 5 (b) in the text describes cutting plastic products into microplastic particles of 1-5 mm and subjecting them to artificial aging treatment in six different water-based substrates. Figure 5 (c) in the diagram represents acquiring a hyperspectral image and extracting the region of interest. Figure 5 (d) in the table represents the classification result of microplastic types. Figure 5 (e) in the table represents the classification result of the degree of microplastic aging. Figure 5 In the equation (f), the model's average confidence score is represented.
[0045] Figure 6 This is a flowchart illustrating an application method for a joint identification model of microplastic type and aging degree provided in Embodiment 2 of this application.
[0046] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of this application. Detailed Implementation
[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] Example 1
[0049] Hyperspectral imaging (HSI) technology integrates both image and spectral information, offering non-contact, non-destructive, and high-throughput capabilities. In recent years, it has shown great potential in the field of microplastic identification, particularly in achieving pixel-level spectral acquisition without sample pretreatment, making it suitable for identifying and analyzing tiny particles in complex backgrounds. However, current applications of HSI technology are mostly limited to microplastic type classification tasks, with a lack of research on identifying the aging degree of microplastics—a key environmental risk characteristic. Furthermore, HSI data is high-dimensional and suffers from significant information redundancy, making it difficult for traditional feature extraction methods to effectively characterize its nonlinear structural features, thus limiting recognition accuracy and model generalization ability. In recent years, deep learning technology has made breakthroughs in image recognition and spectral analysis, possessing end-to-end modeling capabilities and multi-task collaborative learning advantages, enabling the discovery of potential patterns in high-dimensional data without complex feature engineering.
[0050] Based on this, this embodiment proposes an identification method integrating hyperspectral imaging and multi-task deep learning, which intelligently identifies both the type and aging degree of microplastic samples simultaneously, representing a breakthrough in overcoming current technological bottlenecks. This embodiment aims to construct an efficient, accurate, and scalable microplastic identification framework, overcoming the problems of existing methods such as single identification dimensions, complex preprocessing, and weak generalization ability. It can be directly applied to the detection of microplastic samples from various sources, meeting the practical needs of rapid identification and application promotion of environmental samples.
[0051] The microplastic type and aging degree joint identification model training method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the terminal communicates with the server via a network. The data storage system stores the data the server needs to process. The data storage system can be set up independently, integrated into the server, or located in the cloud or on another server. The terminal can send a training request to the server. Upon receiving the request, the server acquires the hyperspectral image and label of each microplastic sample from multiple microplastic samples. The label includes the microplastic type and aging degree. For each hyperspectral image, the server extracts the spectral feature vector of each pixel and sets the corresponding label to the label of each pixel, constructing a dataset. The dataset includes the spectral feature vector and label of each pixel. A deep learning model is then constructed. Using the spectral feature vector as input and the label as the label, the deep learning model is trained using the dataset to obtain a joint identification model for microplastic type and aging degree. The server can then feed back the training result—the joint identification model for microplastic type and aging degree—to the terminal.
[0052] In addition, in some embodiments, the training method for the joint identification model of microplastic type and aging degree can also be implemented by the server or the terminal alone. For example, the terminal can directly process the training request to be processed, or the server can obtain the training request to be processed from the data storage system and process it.
[0053] The terminals can be, but are not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices, while portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Servers can be implemented using independent servers, server clusters composed of multiple servers, or cloud servers.
[0054] In one exemplary embodiment, such as Figure 2 As shown, a method for training a joint identification model of microplastic type and aging degree is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 The following steps are used as an example of a server in the example.
[0055] Step S1: Obtain a hyperspectral image and sample label for each of the multiple microplastic samples; the sample label includes the microplastic type and the degree of microplastic aging.
[0056] Step S2: For each sample hyperspectral image, extract the sample spectral feature vector of each sample pixel in the sample hyperspectral image, and set the sample label corresponding to the sample hyperspectral image as the sample label of each sample pixel in the sample hyperspectral image to construct a dataset; the dataset includes the sample spectral feature vector and sample label of each sample pixel.
[0057] Step S3: Construct a deep learning model.
[0058] Step S4: Using the sample spectral feature vector of the sample pixel as input and the sample label of the sample pixel as label, the deep learning model is trained using the dataset to obtain a joint identification model of microplastic type and aging degree.
[0059] By implementing steps S1 to S4 above, this embodiment provides a training method for a joint identification model of microplastic type and aging degree based on hyperspectral imaging and a deep learning model. The deep learning model is trained using the spectral feature vector and sample label of each sample pixel in the hyperspectral image to obtain the joint identification model of microplastic type and aging degree. Subsequently, the spectral feature vector of each pixel in the hyperspectral image is directly used as input to achieve joint identification of microplastic type and aging degree using the joint identification model. This method only requires acquiring hyperspectral images, does not rely on complex sample preprocessing procedures, has a short testing cycle, high throughput, and can improve identification efficiency. Furthermore, the introduction of a deep learning model can improve identification accuracy.
[0060] To systematically characterize the types and aging degrees of microplastics (MPs), this embodiment establishes a complete experimental framework, including sample preparation, spectral acquisition, and model development, such as... Figure 3 As shown, firstly, five types of microplastics were artificially aged and characterized using Fourier transform infrared spectroscopy (FTIR) and near-infrared hyperspectral imaging (NIR-HSI) to construct a dataset for modeling. Subsequently, a multi-task deep learning model (RAMT) was developed to simultaneously predict the type and degree of aging of microplastics. Finally, the model performance was evaluated through five-fold cross-validation, interpretability analysis, and external validation. The external validation samples included artificially aged multicolored commercial microplastics in six different river and lake bodies. Figure 3 The process of hyperspectral acquisition, preprocessing, model training, and online recognition is demonstrated below. Figure 3The training method for the joint identification model of microplastic type and aging degree in this embodiment is described in detail, including the following steps.
[0061] (I) Spectral Information Acquisition and Preprocessing
[0062] This embodiment uses a hyperspectral camera (or hyperspectral imager) to acquire spectral information of microplastic samples, and performs preprocessing on the spectral information using SG (Savitzky-Golay) filtering and SNV (Standard Normal Variation) normalization.
[0063] (1) Hyperspectral image acquisition and spectral feature vector construction
[0064] This embodiment uses a hyperspectral camera to observe different aging levels (based on CI (Carbonyl)). The CI index is used to classify aging. The larger the CI index, the higher the degree of aging. For example, based on the CI index, aging can be divided into low aging, medium aging, and high aging. The range of CI index values corresponding to low aging, medium aging, and high aging can be determined according to user needs. Spectroscopic acquisition is performed on microplastic samples (such as soil samples containing microplastics and air samples containing microplastics) of different types (such as polypropylene PP, polystyrene PS, polyvinyl chloride PVC, polylactic acid PLA, and polycaprolactone PCL). Specifically, a SWIR hyperspectral camera (or other hyperspectral cameras) can be used in the 900-2500nm band (or other bands) to acquire hyperspectral images of microplastic samples in a push-broom mode (i.e., line-scanning). The hyperspectral image of the sample includes two-dimensional spatial information and spectral information, that is, it includes the two-dimensional position coordinates of each sample pixel and the initial sample spectral feature vector. The initial sample spectral feature vector includes the reflectance of the sample pixel at each wavelength in the 900-2500nm band.
[0065] Spatial cropping is performed on the sample hyperspectral image to extract sample pixels from the effective region. The effective region refers to the ROI (Region of Interest), specifically the area where microplastic particles are located, which is manually selected in the sample hyperspectral image. After determining the effective region, the sample hyperspectral image can be cropped to obtain the cropped sample hyperspectral image corresponding to the effective region. Furthermore, the initial sample spectral feature vector of each sample pixel in the cropped sample hyperspectral image is obtained.
[0066] (2) Spectral information preprocessing
[0067] To improve the robustness and accuracy of model learning, the initial sample spectral feature vectors are preprocessed as follows:
[0068] 1) SG filtering: used to smooth the initial sample spectral feature vector of each sample pixel and retain key information to obtain the filtered sample spectral feature vector, using a window length of 11 and a second-order polynomial.
[0069] 2) SNV standardization: The filtered sample spectral feature vector of each sample pixel is normalized by removing the mean and dividing by the standard deviation to eliminate the influence of light source or sample quality fluctuations.
[0070] After the above preprocessing operations, the standardized sample spectral feature vector is finally obtained, which is used for subsequent modeling. Of course, in this embodiment, preprocessing operations can also be omitted, and the initial sample spectral feature vector can be directly used as the sample spectral feature vector for subsequent modeling.
[0071] (3) Dataset Construction
[0072] After preprocessing, a sample spectral feature vector is constructed for each sample pixel. At the same time, each sample pixel is assigned a type label (i.e., material type label, specifically microplastic type) and an aging degree label (specifically, microplastic aging degree), thus obtaining the dataset.
[0073] In this embodiment, a hyperspectral image and a sample label are obtained for each of the multiple microplastic samples. The sample label includes the microplastic type and the degree of microplastic aging. For each sample hyperspectral image, the sample spectral feature vector of each sample pixel in the sample hyperspectral image is extracted, and the sample label corresponding to the sample hyperspectral image is set as the sample label of each sample pixel in the sample hyperspectral image. A dataset is constructed, which includes the sample spectral feature vector and the sample label of each sample pixel.
[0074] The hyperspectral images of the samples were obtained by using a SWIR hyperspectral camera to image the microplastic samples in the 900-2500nm band in a push-broom manner. The types of microplastics included PP, PS, PVC, PLA and PCL. The degree of aging of the microplastics was determined based on the CI index.
[0075] The process involves extracting the spectral feature vector of each sample pixel in the hyperspectral image of the sample, and setting the sample label corresponding to the hyperspectral image of the sample as the sample label of each sample pixel in the hyperspectral image of the sample, thus constructing a dataset. Specifically, this includes: cropping the hyperspectral image of the sample to obtain the cropped hyperspectral image of the sample corresponding to the ROI region in the microplastic sample, where the ROI region is the area where the microplastic is located; extracting the spectral feature vector of each sample pixel in the cropped hyperspectral image of the sample, and setting the sample label corresponding to the cropped hyperspectral image of the sample (i.e., the sample label of the microplastic sample to which the cropped hyperspectral image of the sample belongs) as the sample label of each sample pixel in the cropped hyperspectral image of the sample, thus constructing a dataset.
[0076] Specifically, the extraction of the sample spectral feature vector for each sample pixel in the cropped sample hyperspectral image includes: extracting the spectral information of each sample pixel in the cropped sample hyperspectral image to obtain the initial sample spectral feature vector; filtering the initial sample spectral feature vector using the SG filtering algorithm to obtain the filtered sample spectral feature vector of the sample pixel; and standardizing the filtered sample spectral feature vector using the SNV normalization algorithm to obtain the sample spectral feature vector of the sample pixel.
[0077] (II) Model Construction
[0078] This embodiment constructs a multi-task convolutional neural network model that integrates an uncertainty-weighted loss function (i.e., introduces an uncertainty measure to dynamically adjust the weights of the loss function) (or can be replaced by other types of deep learning models) to achieve classification prediction of microplastic type (such as PP, PS, PVC, PLA and PCL) and aging degree (such as low aging, medium aging and high aging).
[0079] When constructing a multi-task convolutional neural network model, this embodiment proposes a 1D (i.e., one-dimensional) multi-task convolutional neural network model that integrates residual structures and SE (Squeeze-and-Excitation, channel) attention mechanisms. This model includes 1D convolution, residual blocks, SE attention mechanisms, and branching structures, specifically comprising the following modules:
[0080] (1) Shared feature extraction branch
[0081] 1) Convolutional module and residual module: The input is a 1D spectral feature vector. 1D convolution is used to extract spectral temporal features, and residual connections are embedded to prevent gradient vanishing.
[0082] 2) Attention mechanism module: Enhances key band response and improves feature selection capability through feature channel weighting mechanism.
[0083] (2) Task Branch Module
[0084] 1) Type recognition branch: A fully connected structure is adopted to finally output the multi-classification prediction results of microplastic types.
[0085] 2) Aging degree identification branch: A fully connected structure is adopted to finally output the multi-classification prediction results of the aging degree of microplastics.
[0086] In this embodiment, a deep learning model is constructed, which includes a shared feature extraction branch, a type recognition branch, and an aging degree recognition branch. The output of the shared feature extraction branch is connected to the input of the type recognition branch and the first input of the aging degree recognition branch, respectively. The first output of the type recognition branch is connected to the second input of the aging degree recognition branch.
[0087] The shared feature extraction branch is used to extract features from the spectral feature vector to obtain shared features.
[0088] The type recognition branch is used to determine the probability of each microplastic type based on shared features, and to determine the microplastic type identification result based on the probability of each microplastic type.
[0089] The aging degree identification branch is used to determine the probability of aging degree of each microplastic based on shared features and the probability of each microplastic type, and to determine the identification result of microplastic aging degree based on the probability of aging degree of each microplastic.
[0090] (1) Shared feature extraction branch
[0091] The shared feature extraction branch consists of a convolutional module, several residual modules, and an attention mechanism module connected in sequence. The input of the convolutional module is the input of the shared feature extraction branch, used to receive the spectral feature vector. The output of the attention mechanism module is the output of the shared feature extraction branch, used to output the shared features.
[0092] The convolutional module includes a first convolutional layer, a first batch of normalization layers, and a first max pooling layer connected in sequence. The input of the first convolutional layer is the input of the convolutional module, which is also the input of the shared feature extraction branch.
[0093] The residual module includes a second convolutional layer, a second batch normalization layer, a third convolutional layer, a third batch normalization layer, a fourth convolutional layer, a first addition layer, a second max pooling layer, a fifth convolutional layer, a fourth batch normalization layer, a sixth convolutional layer, a fifth batch normalization layer, a seventh convolutional layer, and a second addition layer, all connected in sequence. The input of the second convolutional layer of the first residual module, the input of the first addition layer of each residual module, and the input of the second addition layer of each residual module are all connected to the output of the first max pooling layer in the convolutional module.
[0094] The attention mechanism module is a channel attention mechanism module, which includes a first global average pooling layer, a first fully connected layer, a second fully connected layer, a reshape layer (a network layer used to change the shape of the tensor; it does not change the total number of elements in the data, but can rearrange these elements to meet the input requirements of subsequent layers, such as reshaping 256 into 1*256), a first multiplication layer, and a second global average pooling layer. The inputs of the first global average pooling layer and the first multiplication layer are both connected to the output of the second addition layer of the last residual module. The output of the second global average pooling layer is the output of the attention mechanism module, which is the output of the shared feature extraction branch.
[0095] (2) Type recognition branch
[0096] The type recognition branch includes a third fully connected layer and a first Dropout layer connected in sequence. The input of the third fully connected layer is the input of the type recognition branch and is connected to the output of the shared feature extraction branch, that is, the output of the second global average pooling layer in the attention mechanism module of the shared feature extraction branch, which is used to receive shared features. The output of the third fully connected layer is the first output of the type recognition branch, which is used to output the probability of each microplastic type. The output of the first Dropout layer is the second output of the type recognition branch, which is used to output the microplastic type recognition result, that is, to select the microplastic type with the highest probability as the microplastic type recognition result.
[0097] (3) Aging degree identification branch
[0098] The aging degree recognition branch consists of a gated unit layer, a second multiplication layer, a splicing layer, a fourth fully connected layer, a second dropout layer, and a fifth fully connected layer connected in sequence. The inputs of the gated unit layer and the second multiplication layer are both the second inputs of the aging degree recognition branch. The first output of the connection type recognition branch, i.e., the output of the third fully connected layer in the connection type recognition branch, is used to receive the probability of each microplastic type. At this time, the second multiplication layer multiplies the output of the gated unit layer and the output of the third fully connected layer. The input of the splicing layer is the first input of the aging degree recognition branch. The output of the connection shared feature extraction branch, i.e., the output of the second global average pooling layer in the attention mechanism module of the connection shared feature extraction branch, is used to receive shared features. At this time, the splicing layer splices the output of the second multiplication layer and the output of the second global average pooling layer. The output of the fifth fully connected layer is the output of the aging degree recognition branch, used to output the probability of each microplastic aging degree. Furthermore, based on the probability of each microplastic aging degree, the recognition result of the microplastic aging degree is output, i.e., the microplastic aging degree with the highest probability is selected as the recognition result of the microplastic aging degree.
[0099] To improve the stability and performance of the model when designing the uncertainty-weighted loss function, an uncertainty-based loss weighting mechanism is introduced. Task weights are defined based on the model's learnable parameters logσ1 and logσ2. The initial values of logσ1 and logσ2 are determined by the user based on prior knowledge. The total loss function is:
[0100] L_total=(1 / σ12)*L_type+(1 / σ22)*L_age+logσ1+logσ2;
[0101] Where L_total is the total loss; σ1 is the standard deviation of the uncertainty of the type recognition branch, which is further determined by the multi-task convolutional neural network model by determining the model's learnable parameter logσ1; L_type is the cross-entropy loss of the type recognition branch, which is calculated using the cross-entropy loss function; σ2 is the standard deviation of the uncertainty of the aging degree recognition branch, which is further determined by the multi-task convolutional neural network model by determining the model's learnable parameter logσ2; and L_age is the cross-entropy loss of the aging degree recognition branch, which is calculated using the cross-entropy loss function.
[0102] This uncertainty-based loss weighting mechanism allows the model to automatically adjust task weights based on task difficulty, achieving an optimal balance.
[0103] (III) Model Training and Application
[0104] This embodiment selects the best model through cross-validation and enables industrial evaluation and online application.
[0105] (1) Dataset partitioning
[0106] For each sample pixel in the dataset, the microplastic type and microplastic aging degree in the sample label are individually encoded. At this time, each sample pixel includes the preprocessed sample spectral feature vector, the individually encoded microplastic type label, and the individually encoded microplastic aging degree label.
[0107] In this embodiment, the dataset is divided into a training set and a test set in an 8:2 ratio (other ratios can also be used). The training set is used for training, and the test set is used for testing. During the training process, the training set is further divided into a training subset and a validation subset.
[0108] (2) Model training and cross-validation
[0109] The Adam optimizer is used for parameter updates, with a batch size of 64 per iteration and a maximum of 500 training epochs.
[0110] Configure Early Stopping (which can be set to check every 10 iterations) and ReduceLROnPlateau (which can be set to check every 5 iterations) callback functions to prevent overfitting.
[0111] Five-fold cross-validation was performed, and the model with the best average performance was selected and saved. The average performance was characterized by the average F1 score of the two tasks: microplastic type and microplastic aging degree.
[0112] (3) Model evaluation and visualization analysis
[0113] The classification performance of microplastic type and microplastic aging degree was evaluated on the test set, using Accuracy, Precision, Recall, F1-score, and Kappa coefficient of Confusion Matrix as performance evaluation indicators.
[0114] Output a classification report (including the values of each performance evaluation metric), such as Figure 4 As shown, Figure 4 For the RAMT model to comprehensively assess type and degree of aging, Figure 4 In the diagram, (a) and (b) represent the training process of 5-fold cross-validation. Figure 4 In Figure (a), the loss curves for training and validation are shown. The shaded area represents ±1σ, where σ = 0.060. Figure 4 In Figure (b), the accuracy curves for training and validation are shown, representing the classification accuracy for type (green, final accuracy > 99%, σ < 0.001) and aging level (orange, final accuracy 95%, σ = 0.021). Figure 4 In the diagram, (c) and (d) are the confusion matrices on the test set. Figure 4 In the matrix, (c) represents the confusion matrix for type classification. Figure 4 In the matrix, (d) represents the confusion matrix for classifying aging levels. Figure 4 (e) in the figure represents a comparison of the comprehensive performance indicators between the two tasks: type classification and aging degree classification. Figure 4 In the table, (f) represents the F1 score (>0.85) for different classification types. The RAMT model is trained on hyperspectral data to jointly predict the type and aging degree of microplastics. Figure 4 As shown in (a), the training loss and validation loss continuously decrease during training and tend to stabilize after the 40th round, eventually converging to about 0.2, indicating that the model learning process is efficient and stable. The validation loss has a low standard deviation (σ = 0.06) in different trade-offs, further indicating that the model has good convergence and no overfitting phenomenon has occurred. Figure 4Figure (b) illustrates the accuracy trend during training: the microplastic type classification accuracy quickly reached 100% in the early stages, thanks to the introduction of residual connections and SE attention mechanisms in the backbone network, while the aging degree classification accuracy gradually increased from 50% to 95.2%, partly due to the gating mechanism effectively integrating type information as prior knowledge. Model performance was further evaluated using an independent test set, such as... Figure 4 As shown in (c) and (d), the RAMT model achieved 100% accurate classification across all five microplastic types, demonstrating its excellent spectral discrimination ability. For the classification of aging degree, the accuracy rates for mild, moderate, and severe aging samples were 91%, 92%, and 99%, respectively. A small number of misclassifications occurred between mild and moderate aging, possibly due to partial similarity in their spectral features. To comprehensively evaluate the model's performance, key metrics such as accuracy, precision, recall, F1 score, and Kappa coefficient were also calculated for both type and aging degree tasks. Figure 4 As shown in (e), all indicators exceed 0.90, indicating high accuracy and reliability of the model. It is worth noting that the F1 scores for aging degree classification differ between different types, such as... Figure 4 As shown in (f), PVC (1.00) and PP (0.96) performed well, while PCL (0.87) was slightly lower, suggesting that different materials have their own unique spectral evolution characteristics during the aging process. These results demonstrate that the RAMT model can efficiently and accurately achieve the joint identification of microplastic type and aging degree.
[0115] This embodiment further analyzes the sources of various label recognition errors, specifically identifying labels with high error rates from the classification report. For example, when classifying aging levels, it is difficult to identify low and medium aging levels. Further analysis is conducted to determine whether the spectral curves are similar, whether it is an edge region, or whether it is a contaminated sample. Interpretability tools can also be used to analyze the decision basis of the model, which can explain where the model's recognition bottleneck is and whether the model design is reasonable.
[0116] (4) External prediction validation of real-life samples
[0117] To verify the model's generalization and practical application capabilities, the trained model was applied to real microplastic samples collected in real-life scenarios. The same spectral acquisition and preprocessing (SG filtering + SNV normalization) were performed, and the samples were then input into the trained model to directly predict their type and aging degree without the need for retraining.
[0118] like Figure 5 As shown, Figure 5 The results show the external validation of the RAMT model using six water matrices (including five types of natural water (such as river water and lake water) and ultrapure water). Figure 5(a) in the text represents representative plastic products from everyday life. Figure 5 (b) in the text describes cutting plastic products into microplastic particles of 1-5 mm and subjecting them to artificial aging treatment in six different water-based substrates. Figure 5 (c) in the image shows the acquisition of a hyperspectral image and the extraction of the region of interest (ROI). Figure 5 (d) in the table represents the classification result of microplastic types. Figure 5 (e) in the table represents the classification result of the degree of microplastic aging. Figure 5 In the figure, (f) represents the model's average confidence score, and the error bars represent the 95% confidence interval. To evaluate the generalization ability and robustness of the RAMT model in real-world environments, this embodiment used various colored commercial plastic products and artificially aged them in six different water matrices to conduct external validation experiments. Unlike pure polymer particles aged under controlled laboratory conditions used for model training, this external validation set used everyday plastic products such as straws and food containers, exposed to a more complex environmental system. These environmental water bodies varied significantly in terms of ionic strength, natural organic matter content, and suspended particles, posing a greater challenge to the model's environmental adaptability. In all water matrices, the RAMT model maintained a high classification accuracy, and the confidence scores for both type and aging degree classifications exceeded 0.90, validating its strong robustness in variable environments. Notably, even when trained only on colorless plastic samples, the model could still accurately identify different colored microplastic types, indicating that its identification relies on the intrinsic spectral characteristics of the material rather than its surface color. Some key misclassifications included: a beverage bottle cap identified as PP by FTIR was classified as PVC by the model, possibly because food-grade additives (such as plasticizers) masked its typical spectral characteristics; another straw labeled PLA was not correctly identified, and FTIR analysis also failed to confirm it as pure PLA, suggesting it might be a modified or blended material. Such discrepancies between labeling and actual composition are common in consumer products, revealing the practical challenges of identifying non-standard materials. In terms of aging degree classification, the model also demonstrated high reliability, with confidence levels between 0.85 and 0.94, indicating its applicability in dynamic aquatic environments. More importantly, thanks to the pixel-level resolution of hyperspectral imaging, the model can accurately capture the spatial differences in aging degrees within microplastic particles. For example... Figure 5In the area marked by the yellow box in (b) of the model, even with visually uneven aging, the model can still accurately identify it. This capability effectively overcomes the limitations of traditional methods in dealing with uneven aging (such as the effects of light, humidity, and microorganisms). In summary, the RAMT model can still achieve simultaneous and accurate prediction of microplastic type and aging degree under complex and variable environmental conditions, demonstrating broad applicability. Meanwhile, the spatial resolution characteristics of HSI make it possible to quantify the aging heterogeneity within microplastics. For example, by calculating the ratio of highly aged to lightly aged regions in a single particle, a higher-dimensional aging assessment capability than traditional methods such as FTIR can be obtained, highlighting its unique advantages in environmental microplastic monitoring.
[0119] Experiments show that the trained model maintains a high level of recognition accuracy on real-life samples, proving its feasibility for online deployment and industrial application.
[0120] In this embodiment, the sample spectral feature vector of the sample pixel is used as input, and the sample label of the sample pixel is used as label. The deep learning model is trained using the dataset to obtain a joint identification model of microplastic type and aging degree.
[0121] The model uses the sample spectral feature vector of each sample pixel as input and the sample label of each sample pixel as label. It then trains a deep learning model using the dataset to obtain a joint identification model for microplastic type and aging degree. Specifically, this includes:
[0122] (1) Divide the dataset into training set and test set.
[0123] (2) Using the sample spectral feature vector of the sample pixels in the training set as input and the sample label of the sample pixels in the training set as label, the deep learning model is trained using the training set to obtain a joint identification model of microplastic type and aging degree.
[0124] A deep learning model is trained using a training set to obtain a joint identification model for microplastic type and aging degree. Specifically, this involves training the deep learning model using 5-fold cross-validation based on the training set. During the training process, the Adam optimizer, early stopping mechanism training strategy, learning rate decay training strategy, and uncertainty-weighted loss function are employed. The uncertainty-weighted loss function is a weighted sum of the loss functions of the type identification branch and the aging degree identification branch in the deep learning model. Both the type identification branch loss function and the aging degree identification branch loss function use the cross-entropy loss function.
[0125] (3) The joint identification model of microplastic type and aging degree is tested using the test set to obtain the performance of the joint identification model of microplastic type and aging degree. The performance is characterized by performance evaluation indicators, including accuracy, precision, recall, F1 score and confusion matrix.
[0126] In application, a hyperspectral image of the microplastic sample to be tested is acquired, and the spectral feature vector of each pixel in the hyperspectral image is extracted. For each pixel, the spectral feature vector of the pixel is used as input, and the microplastic type and aging degree of the pixel are determined by the joint identification model of microplastic type and aging degree, thus completing the joint identification of microplastic type and aging degree of the microplastic sample to be tested.
[0127] This embodiment innovatively proposes a method for joint identification of microplastic type and aging degree based on hyperspectral imaging and deep learning model. This method constructs a multi-task convolutional neural network model that integrates residual modules and attention mechanisms, and introduces an uncertainty-weighted loss function to achieve high-precision simultaneous identification of microplastic type and aging degree. At the same time, it has good generalization ability and can be directly applied to the classification and prediction of external real-life samples, and has the potential for practical industrial application.
[0128] Related technology 1 is a multi-sensor hyperspectral fusion identification method, which uses multiple hyperspectral cameras to collect images of different bands, fuses them to generate a high-resolution spectrum, and then combines it with a machine learning model to identify and classify plastics. The advantage is that by fusing data from different bands, it can improve the ability to distinguish difficult-to-identify samples such as black plastics. The limitation is that it is costly, the equipment is complex, and it is not designed to identify the degree of aging, but only detects the material.
[0129] Related technology 2 is a self-supervised contrastive learning hyperspectral classification method. It proposes a self-supervised contrastive learning framework for the classification of soil microplastic hyperspectral images. It enhances the robustness of the model through label-free learning. Its advantage is that it does not require a large number of labeled samples and can maintain performance under sample scarcity. Its limitation is that it focuses on improving classification accuracy and does not have task weighting, attention mechanism and aging recognition function. Although it has strong performance in distinguishing types, it lacks aging prediction ability.
[0130] Related technology 3 is the traditional machine learning + chemical spectral analysis method, which is a microplastic aging classification method based on ATR-FTIR or SVM. For example, it can identify the unaged / aged state of PET (polyethylene terephthalate) with an accuracy of up to 99%. Its advantage is that the chemical information is accurate and can distinguish the degree of aging. Its limitation is that it requires physical sample contact and complex pretreatment, which is time-consuming and cannot achieve high-throughput online identification.
[0131] Clearly, while related technologies have made progress in the identification of microplastics / plastic materials, they either lack the ability to identify aging levels or rely on complex equipment or sample pretreatment. This embodiment, through a combination of single sensor, high throughput, multi-tasking, dynamic weighting, and lightweight models, along with validation on real-life samples, constitutes a competitive and comprehensive technical approach.
[0132] The advantages of this embodiment are as follows:
[0133] (1) Significantly improved recognition efficiency
[0134] Traditional methods typically train two models separately, resulting in high computational resource consumption and low inference efficiency. This embodiment, however, constructs a unified multi-task neural network framework that can simultaneously output two prediction results—microplastic type and aging degree—in a single forward inference, significantly improving recognition efficiency and deployment ease.
[0135] This advantage stems from the proposed multi-task neural network design that includes a shared feature extraction branch and a dual-branch output structure (i.e., a type recognition branch and an aging degree recognition branch), enabling end-to-end parallel recognition and avoiding redundant modeling.
[0136] (2) Higher recognition accuracy, especially better performance in complex spectral environments.
[0137] Existing methods are prone to classification errors in complex backgrounds or nonlinear changes in the aging process. This embodiment enhances the model's ability to perceive key spectral bands by introducing residual connections and channel attention mechanisms, effectively avoiding information decay and overfitting problems, and making the model more accurate in fine classification tasks (such as moderate aging vs. high aging).
[0138] This advantage stems from the introduction of the SE attention mechanism module to enhance feature weight learning. The residual structure alleviates the gradient vanishing and degradation problems of deep networks. The attention mechanism automatically learns the response weights for key bands, improving the utilization rate of effective bands. The residual connections help retain shallow feature information, making the model more stable and generalizable.
[0139] (3) The model training is more robust, avoiding task conflicts or training imbalance.
[0140] Traditional multi-task models often suffer from training imbalances or even mutual interference due to differences in task difficulty or imbalanced samples. To address this, this embodiment introduces a dynamic weighted loss function based on task uncertainty, enabling the model to automatically adjust the training focus of each task and ensure balanced optimization between the two tasks.
[0141] This advantage stems from the design of a joint loss function weighted by uncertainty, which uses the σ parameter to guide the balance between tasks. This loss mechanism originates from the Bayesian uncertainty modeling idea, which makes the contribution of each task change dynamically according to its confidence level, effectively reducing overfitting and task bias.
[0142] (4) It has good adaptability to real external samples, improving the practicality of the model.
[0143] This embodiment not only performs excellently on experimental samples, but also verifies that the model has a good ability to identify actual microplastic samples collected in daily life. It does not require model retraining and only needs to maintain the same preprocessing process to achieve accurate identification. This shows that the method of this embodiment has extremely high promotion value and practical prospects.
[0144] This advantage stems from applying the model to the task of predicting living samples, using the same spectral preprocessing strategy, and combining standardized preprocessing with model structure design, which improves the model's robustness and generalization ability to variations in sample sources.
[0145] Example 2
[0146] The application method for the joint identification model of microplastic type and aging degree provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown depicts a terminal communicating with a server via a network. A data storage system stores the data the server needs to process. This system can be set up independently, integrated into the server, or located in the cloud or on another server. The terminal can send application requests to the server. Upon receiving the request, the server acquires a hyperspectral image of the microplastic sample to be tested; extracts the spectral feature vector of each pixel in the hyperspectral image; and for each pixel, using the spectral feature vector as input, uses a joint microplastic type and aging degree identification model to determine the microplastic type and aging degree of the pixel, thus completing the joint identification of the microplastic type and aging degree of the sample. The server can then feed back the application result—the microplastic type and aging degree obtained in response to the application request—to the terminal.
[0147] Furthermore, in some embodiments, the application method of the joint identification model of microplastic type and aging degree can also be implemented by the server or the terminal alone. For example, the terminal can directly process the application request to be processed, or the server can obtain the application request to be processed from the data storage system and process it.
[0148] In one exemplary embodiment, such as Figure 6As shown, a method for jointly identifying microplastic type and aging degree is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 The following steps are used as an example of a server in the example.
[0149] Step T1: Obtain a hyperspectral image of the microplastic sample to be tested.
[0150] Step T2: Extract the spectral feature vector of each pixel in the hyperspectral image.
[0151] Step T3: For each pixel, using the spectral feature vector of the pixel as input, the microplastic type and microplastic aging degree of the pixel are determined by the joint identification model of microplastic type and aging degree, thus completing the joint identification of microplastic type and aging degree of the microplastic sample to be tested; wherein, the joint identification model of microplastic type and aging degree is a model trained using the training method of the joint identification model of microplastic type and aging degree described in Example 1.
[0152] The extraction of spectral feature vectors for each pixel in the hyperspectral image specifically includes: extracting the spectral information of each pixel in the hyperspectral image to obtain the initial spectral feature vector of the pixel; filtering the initial spectral feature vector using the SG filtering algorithm to obtain the filtered spectral feature vector of the pixel; and standardizing the filtered spectral feature vector using the SNV normalization algorithm to obtain the spectral feature vector of the pixel.
[0153] In this embodiment, the hyperspectral image can also be cropped first to obtain a cropped hyperspectral image, and then the spectral feature vector of each pixel in the cropped hyperspectral image can be extracted.
[0154] This application also provides an application scenario in which the above-mentioned joint identification model method for microplastic type and aging degree is applied. Specifically, the joint identification model method for microplastic type and aging degree provided in this embodiment can be applied in a microplastic identification scenario. The microplastic identification scenario includes an identification stage and a display stage. The identification stage is used to determine the microplastic type and aging degree of each pixel in the microplastic sample to be tested, and the display stage is used to display the microplastic type and aging degree of each pixel in the microplastic sample to be tested to the user. The joint identification model method for microplastic type and aging degree provided in this embodiment belongs to the identification stage.
[0155] Example 3
[0156] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 7 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements either a training method for a joint identification model of microplastic type and aging degree or an application method for such a model.
[0157] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0158] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the training method for the joint identification model of microplastic type and aging degree in Embodiment 1 or the application method of the joint identification model of microplastic type and aging degree in Embodiment 2.
[0159] Example 4
[0160] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the microplastic type and aging degree joint identification model training method of Embodiment 1 or the microplastic type and aging degree joint identification model application method of Embodiment 2.
[0161] Example 5
[0162] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the microplastic type and aging degree joint identification model training method in Embodiment 1 or the microplastic type and aging degree joint identification model application method in Embodiment 2.
[0163] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0164] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0165] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for training a joint identification model of microplastic type and aging degree, characterized in that, The training method for the joint identification model of microplastic type and aging degree includes: Acquire hyperspectral images and sample labels for each of multiple microplastic samples; the sample labels include the microplastic type and the degree of microplastic aging. For each of the sample hyperspectral images, extract the sample spectral feature vector of each sample pixel in the sample hyperspectral image, and set the sample label corresponding to the sample hyperspectral image as the sample label of each sample pixel in the sample hyperspectral image to construct a dataset; the dataset includes the sample spectral feature vector and sample label of each sample pixel; Build deep learning models; Using the sample spectral feature vector of the sample pixel as input and the sample label of the sample pixel as label, the deep learning model is trained using the dataset to obtain a joint identification model of microplastic type and aging degree. The deep learning model includes: a shared feature extraction branch, a type recognition branch, and an aging degree recognition branch. The output of the shared feature extraction branch is connected to the input of the type recognition branch and the first input of the aging degree recognition branch, respectively. The first output of the type recognition branch is connected to the second input of the aging degree recognition branch. The shared feature extraction branch includes a convolutional module, several residual modules, and an attention mechanism module connected in sequence. The convolutional module includes a first convolutional layer, a first batch of normalized layers, and a first max pooling layer connected in sequence. The residual module includes a second convolutional layer, a second batch normalization layer, a third convolutional layer, a third batch normalization layer, a fourth convolutional layer, a first addition layer, a second max pooling layer, a fifth convolutional layer, a fourth batch normalization layer, a sixth convolutional layer, a fifth batch normalization layer, a seventh convolutional layer, and a second addition layer connected in sequence. The input terminals of the second convolutional layer, the first addition layer, and the second addition layer of the first residual module are all connected to the output terminal of the first max pooling layer. The aging degree identification branch includes a gated unit layer, a second multiplication layer, a splicing layer, a fourth fully connected layer, a second Dropout layer, and a fifth fully connected layer connected in sequence. The input terminals of the gated unit layer and the second multiplication layer are both the second input terminals of the aging degree identification branch, and the input terminal of the splicing layer is the first input terminal of the aging degree identification branch.
2. The training method for the joint identification model of microplastic type and aging degree according to claim 1, characterized in that, Extract the spectral feature vector of each sample pixel in the sample hyperspectral image, and set the sample label corresponding to the sample hyperspectral image as the sample label of each sample pixel in the sample hyperspectral image to construct a dataset, specifically including: The hyperspectral image of the sample is cropped to obtain the cropped hyperspectral image of the sample corresponding to the ROI region in the microplastic sample; the ROI region is the region where the microplastic is located. Extract the sample spectral feature vector of each sample pixel in the cropped sample hyperspectral image, and set the sample label corresponding to the cropped sample hyperspectral image as the sample label of each sample pixel in the cropped sample hyperspectral image to construct a dataset.
3. The training method for the joint identification model of microplastic type and aging degree according to claim 2, characterized in that, Extracting the spectral feature vector of each sample pixel in the cropped hyperspectral image specifically includes: For each sample pixel in the cropped hyperspectral image, the spectral information of the sample pixel is extracted to obtain the initial sample spectral feature vector of the sample pixel; the initial sample spectral feature vector is filtered using the SG filtering algorithm to obtain the filtered sample spectral feature vector of the sample pixel; the filtered sample spectral feature vector is normalized using the SNV normalization algorithm to obtain the sample spectral feature vector of the sample pixel.
4. The training method for the joint identification model of microplastic type and aging degree according to claim 1, characterized in that, The shared feature extraction branch is used to extract features from the spectral feature vector to obtain shared features; The type identification branch is used to determine the probability of each microplastic type based on the shared features, and to determine the identification result of the microplastic type based on the probability of each microplastic type; The aging degree identification branch is used to determine the probability of each microplastic aging degree based on the shared features and the probability of each microplastic type, and to determine the identification result of the microplastic aging degree based on the probability of each microplastic aging degree.
5. The training method for the joint identification model of microplastic type and aging degree according to claim 4, characterized in that, The attention mechanism module is a channel attention mechanism module, which includes a first global average pooling layer, a first fully connected layer, a second fully connected layer, a reshape layer, a first multiplication layer, and a second global average pooling layer connected in sequence. The input of the first global average pooling layer and the input of the first multiplication layer are both connected to the output of the second addition layer of the last residual module. The output of the second global average pooling layer is the output of the shared feature extraction branch. The type recognition branch includes a third fully connected layer and a first Dropout layer connected in sequence. The input of the third fully connected layer is the input of the type recognition branch, and the output of the third fully connected layer is the first output of the type recognition branch.
6. The training method for the joint identification model of microplastic type and aging degree according to claim 1, characterized in that, Using the sample spectral feature vectors of the sample pixels as input and the sample labels of the sample pixels as labels, the deep learning model is trained using the dataset to obtain a joint identification model for microplastic type and aging degree, specifically including: The dataset is divided into a training set and a test set; Using the sample spectral feature vectors of sample pixels in the training set as input and the sample labels of sample pixels in the training set as labels, the deep learning model is trained using the training set to obtain a joint identification model for microplastic type and aging degree. The joint identification model of microplastic type and aging degree is tested using the test set to obtain the performance of the joint identification model of microplastic type and aging degree; wherein, the performance is characterized by performance evaluation indicators, including accuracy, precision, recall, F1 score and confusion matrix.
7. The training method for the joint identification model of microplastic type and aging degree according to claim 6, characterized in that, The deep learning model is trained using the training set to obtain a joint identification model for microplastic type and aging degree. Specifically, this includes: training the deep learning model using 5-fold cross-validation based on the training set to obtain the joint identification model for microplastic type and aging degree; wherein, during the training process of the deep learning model, the Adam optimizer, early stopping mechanism training strategy, learning rate decay training strategy, and uncertainty-weighted loss function are used. The uncertainty-weighted loss function is a weighted sum of the loss functions of the type identification branch and the aging degree identification branch in the deep learning model, and both the loss functions of the type identification branch and the loss functions of the aging degree identification branch use the cross-entropy loss function.
8. A method for applying a joint identification model of microplastic type and aging degree, characterized in that, The application method of the joint identification model of microplastic type and aging degree includes: Acquire hyperspectral images of the microplastic sample to be tested; Extract the spectral feature vector of each pixel in the hyperspectral image; For each pixel, the spectral feature vector of the pixel is used as input, and the microplastic type and aging degree of the pixel are determined by the joint identification model of microplastic type and aging degree, thereby completing the joint identification of microplastic type and aging degree of the microplastic sample to be tested; wherein, the joint identification model of microplastic type and aging degree is a model trained by the training method of the joint identification model of microplastic type and aging degree according to any one of claims 1-7.
9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the training method for the joint identification model of microplastic type and aging degree as described in any one of claims 1-7 or the application method for the joint identification model of microplastic type and aging degree as described in claim 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the training method for the joint identification model of microplastic type and aging degree as described in any one of claims 1-7 or the application method of the joint identification model of microplastic type and aging degree as described in claim 8.