A method and system for quality detection of donkey-hide gelatin products based on multispectral manifold feature mapping and attention-enhanced convolutional networks.
By mapping the one-dimensional molecular spectral data of finished donkey-hide gelatin products into two-dimensional multi-channel images and combining deep learning technology, the problem of multi-dimensional quality judgment of finished donkey-hide gelatin products has been solved, realizing rapid, non-destructive, and automated detection, which is suitable for batch release and process monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
- Filing Date
- 2026-02-09
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies are insufficient for quickly, non-destructively, and automatically achieving multi-dimensional quality assessment of finished donkey-hide gelatin products, including authenticity identification, source components, place of origin, brand, and grade classification, and lack the ability to screen for unknown anomalies.
One-dimensional molecular spectral data of donkey-hide gelatin products are mapped into two-dimensional multi-channel images through manifold learning. Feature mapping deep learning is then performed on the multi-channel images, and multi-scale features are extracted using convolutional neural networks to achieve the classification and discrimination of the quality of donkey-hide gelatin products.
It enables rapid, non-destructive, and automated quality testing of donkey-hide gelatin products, suitable for batch release and process monitoring. It is adaptable to multiple tasks, can identify grades, brands, and abnormal samples, shortens the testing cycle, and improves testing efficiency and accuracy.
Smart Images

Figure CN122306744A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of food and Chinese medicinal material quality testing, molecular spectroscopy analysis and intelligent detection technology, and in particular to a method and system for quality testing of donkey-hide gelatin products based on multispectral manifold feature mapping and attention-enhanced convolutional networks. Background Technology
[0002] Donkey-hide gelatin (Ejiao), a product with a long history of medicinal and edible use in Chinese food culture, is widely used as a functional food and a traditional Chinese medicine for replenishing blood. However, with the rise in market demand and commercial value, Ejiao products face serious risks of quality deviations and adulteration. The market is rife with the use of non-donkey-hide gelatin from cowhide or pigskin to counterfeit Ejiao, or the adulteration with inferior or synthetic materials. Furthermore, the quality of products from different brands, origins, and grades varies significantly. These problems not only seriously damage the therapeutic efficacy and safety of Ejiao but also weaken consumer trust and hinder the standardization of the traditional Chinese medicine industry. Therefore, developing efficient, non-destructive, and multi-dimensional evaluation methods for identifying the quality and authenticity of Ejiao is particularly urgent.
[0003] Existing identification techniques for traditional Chinese medicine (TCM) primarily rely on targeted chemical analysis or biomolecular detection. While liquid chromatography (HPLC, UPLC) and mass spectrometry (MS) can accurately quantify bioactive markers (such as characteristic peptides or secondary metabolites) in TCM, they often require cumbersome sample pretreatment processes such as acid hydrolysis and solid-phase extraction. These methods are not only time-consuming, labor-intensive, and costly, but also destructive, making them unsuitable for rapid on-site screening or large-scale quality control. Although immunological methods such as enzyme-linked immunosorbent assay (ELISA) are specific for bio-origin identification, they are prone to cross-reactivity when handling degraded samples or closely related species, limiting their application in complex or highly processed TCM products.
[0004] Given the aforementioned limitations, vibrational spectroscopy techniques (such as SERS, FT-IR, and NIR) have become powerful tools for food quality and safety assessment due to their speed, non-destructive nature, and rich information content. SERS, with its high sensitivity and molecular fingerprinting capabilities, is commonly used to detect residues and adulterants in food matrices. FT-IR, combined with chemometric modeling, has been successfully applied to the component analysis and traceability of complex foods. In particular, near-infrared spectroscopy (NIR) offers advantages such as simple sample preparation, rapid response, and suitability for online analysis, demonstrating excellent performance in component quantification and origin traceability.
[0005] However, spectral data is inherently high-dimensional, highly correlated, and nonlinear, making it difficult to interpret compositional variations and their correlation with origin and processing factors based solely on a single band or empirical analysis. Traditional chemometric methods (such as PCA, PLS, and LDA), while effective in dimensionality reduction and noise reduction, are typically based on linear assumptions. Even traditional machine learning algorithms such as Support Vector Machines (SVM) and Random Forests (RF) largely rely on manually designed features or predefined transformations, making it difficult to fully capture the hierarchical features or strongly nonlinear relationships in complex datasets.
[0006] In recent years, the rise of deep learning (DL) architectures (such as one-dimensional convolutional neural networks 1D-CNN) has provided new solutions for spectral analysis. DL algorithms can achieve end-to-end feature extraction, automatically discover discriminative spectral patterns, and suppress noise without relying on tedious preprocessing based on expert experience. Furthermore, deep learning has significant advantages in handling nonlinear information and adapting to domain shifts caused by different instruments or batches through transfer learning. However, current research on donkey-hide gelatin products mainly focuses on near-infrared spectroscopy combined with traditional chemometrics methods, with few studies utilizing deep learning frameworks to address the comprehensive identification challenges of donkey-hide gelatin across multiple dimensions, including authenticity, source components (donkey, cattle, turtle, deer), origin, brand, and grade classification. Summary of the Invention
[0007] To address the aforementioned problems in the existing technology, the purpose of this disclosure is to propose a method and system for quality testing of donkey-hide gelatin products. This method and system are based on near-infrared spectral data and feature mapping deep learning to determine the quality of donkey-hide gelatin products, which can significantly shorten the testing cycle and is suitable for batch release and process monitoring.
[0008] To achieve the above-mentioned technical objectives, a method for quality testing of donkey-hide gelatin products is proposed. The one-dimensional molecular spectral data of the donkey-hide gelatin products is mapped into two-dimensional multi-channel images using manifold learning. Based on the multi-channel images, feature mapping deep learning is performed to obtain the quality classification of the donkey-hide gelatin products.
[0009] In the above technical solution, the spectrum used to obtain the one-dimensional molecular spectral data of the finished donkey-hide gelatin product is one or more of the following: near-infrared spectroscopy, Fourier transform infrared spectroscopy, and surface-enhanced Raman spectroscopy.
[0010] In the above technical solution, the near-infrared spectrum acquisition band is 4000-9000 nm. The infrared spectrum acquisition band is 400-4000. The acquisition wavelength range for surface-enhanced Raman spectroscopy is 600-1700 nm. .
[0011] In the above technical solution, before mapping, the one-dimensional molecular spectral data of the donkey-hide gelatin product is subjected to basic signal processing and data preprocessing. The basic signal processing includes removing invalid bands, correcting baseline drift, and eliminating dimensional differences. The data preprocessing includes performing Z-score normalization on near-infrared and infrared spectra to unify the scale, using an asymmetric least squares algorithm to correct the baseline of surface-enhanced Raman spectra, and combining Savitzky-Golay filtering algorithm for smoothing to improve the signal-to-noise ratio.
[0012] In the above technical solution, the feature mapping deep learning is implemented using a deep learning classification and discrimination model. This model is trained according to the spectral type, and after training, the model weights and parameters corresponding to near-infrared spectroscopy, Fourier transform infrared spectroscopy, and surface-enhanced Raman spectroscopy are obtained. During inference, the corresponding model weights and parameters are loaded according to the spectral type. The deep learning classification and discrimination model includes a convolutional neural network module, a multi-scale feature fusion module, a self-attention feature calibration module, and a classification output module. The convolutional neural network module is configured to take multi-channel images as input and extract multi-scale shallow texture features of donkey-hide gelatin from the spectral data using convolutional layers and pooling layers. The multi-scale feature fusion module is configured to fuse multi-size shallow texture features of donkey-hide gelatin through channel splicing to simultaneously capture response peak features of varying widths in the spectrum. The self-attention module is configured to dynamically weight the spliced and fused multi-scale features to automatically suppress noise interference. The classification output module is configured to perform dimensionality reduction processing on the weighted features using a max-pooling layer and then output the quality classification of the finished donkey-hide gelatin product using a fully connected layer.
[0013] In the above technical solution, the one-dimensional molecular spectral data of the donkey-hide gelatin product is mapped to a two-dimensional spatial layout while maintaining the topological structure; the mapped bands are discretized into preset two-dimensional grid pixels, and the corresponding spectral intensity values are filled into the pixel positions, thereby converting the one-dimensional molecular spectral sequence into a two-dimensional multi-channel image.
[0014] In the above technical solution, the quality classification of the finished donkey-hide gelatin product includes one or more of the following: authenticity of the donkey-hide gelatin, brand of the donkey-hide gelatin, grade of the donkey-hide gelatin, whether the color of the donkey-hide gelatin is abnormal, and whether the water-soluble content exceeds the standard.
[0015] To achieve the above-mentioned technical objectives, a quality testing system for donkey-hide gelatin products is provided. The system includes a spectral acquisition terminal, a memory, and a processor. The acquisition terminal includes a near-infrared spectrometer and an adapter probe. The memory stores a computer program that can be loaded by the processor and executed according to any of the quality testing methods for donkey-hide gelatin products in this application.
[0016] To achieve the above-mentioned technical objectives, a computer-readable storage medium is provided, storing a computer program that can be loaded by a processor and executed any of the quality testing methods for donkey-hide gelatin products described in this application.
[0017] To achieve the above-mentioned technical objectives, a quality inspection system for donkey-hide gelatin products is provided. The system includes: a mapping module configured to map one-dimensional molecular spectral data of the donkey-hide gelatin product into a two-dimensional multi-channel image using manifold learning; and a deep learning classification and discrimination model module configured to perform feature mapping deep learning based on the multi-channel image to obtain a quality classification judgment of the donkey-hide gelatin product.
[0018] The beneficial technical effects of this disclosure are as follows: (1) Strong feature expression capability and improved robustness: One-dimensional spectrum is converted into two-dimensional multi-channel feature map through feature mapping, which is convenient for deep learning to extract multi-scale difference features. (2) Fast detection speed and suitable for high throughput: Based on the spectral acquisition and model inference output of discrimination results, the detection cycle can be significantly shortened, which is suitable for batch release and process monitoring. (3) Portable detection method and adaptable to online deployment requirements: Based on the lightweight deep learning architecture adopted in this solution, only the pre-trained model weights of the corresponding spectrum need to be loaded in the model inference process. The computational load is low and the response speed is fast. It can be adapted to the computing unit of portable detection terminal or online monitoring system, providing algorithm support for online quality control or near-line rapid screening of donkey-hide gelatin products. (4) Strong multi-task adaptability: Under the same overall framework, grade discrimination, brand recognition and abnormal sample recognition can be realized, and can be flexibly configured through multi-task model or multi-model method. (5) Applicable to enterprise release, batch consistency control and anomaly screening: It can conduct early warning screening for abnormal states such as abnormal color and excessive water-insoluble matter content, and provide data support for consistency evaluation and quality traceability. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0020] Figure 1 This is a schematic diagram of the structural framework of a quality inspection system for donkey-hide gelatin products.
[0021] Figure 2 This is a schematic diagram of the data flow for deep learning classification of the spectrum of a finished donkey-hide gelatin product.
[0022] Figure 3 This is a performance comparison chart of one implementation method with other traditional models in a brand classification task. Detailed Implementation
[0023] Although existing technologies provide multiple implementation paths for spectral detection and quality evaluation of donkey-hide gelatin or related products, they still have the following shortcomings in terms of integrated, rapid, non-destructive, and automated application requirements for "grade discrimination, brand identification, and detection of abnormal samples (such as color abnormalities, excessive water-insoluble matter, etc.)" of donkey-hide gelatin finished products: (1) Insufficient depth of data mining: Existing technologies mostly use traditional chemometrics (such as PLS) or shallow neural networks, directly modeling based on one-dimensional spectral vectors. Due to the serious collinearity and weak features of spectral data, one-dimensional input cannot fully utilize the advantages of deep learning in local feature extraction and nonlinear expression, resulting in a bottleneck in the discrimination accuracy of "small differences between true and false" or "different grades from the same source". (2) Lack of abnormal screening capability: Existing solutions are mostly "directional detection" (measuring moisture, measuring protein, measuring specific brands), lacking the ability to "non-directionally screen" unknown abnormalities (such as color abnormalities caused by process deviations, atypical adulteration). (3) Low utilization of multi-source information: Existing multispectral schemes (such as LIBS+NIR) are mostly simple data splicing, without considering the physical complementarity of different spectra (such as NIR mainly looking at the overtones of hydrogen-containing groups, and IR looking at the fundamental frequency of the fingerprint region), lacking a main-auxiliary synergistic engineering strategy, which makes it difficult to balance detection efficiency and accuracy.
[0024] Based on this, this disclosure proposes a quality detection method and system for donkey-hide gelatin products based on near-infrared spectral data and feature mapping deep learning, so as to achieve rapid, non-destructive, and automated identification of grade judgment, brand differentiation, and abnormal samples (including but not limited to color abnormalities, excessive water-insoluble matter content, etc.) of donkey-hide gelatin products, and can be adapted to application scenarios such as batch release, batch-to-batch consistency control, and anomaly screening.
[0025] The following description, in conjunction with the accompanying drawings, clearly and completely describes how the technical solution of this case is implemented. Obviously, the described embodiments are only a part of the embodiments of this case, and not all of them. Based on the embodiments in this case, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.
[0026] This invention can be a system, method, and / or computer program product.
[0027] In one embodiment, a method for quality testing of finished donkey-hide gelatin product includes at least the following steps.
[0028] S1. Collect molecular spectral data of the finished donkey-hide gelatin product to be tested. The molecular spectral data is a one-dimensional spectral sequence that can characterize the vibrational fingerprint or energy level transition information of the sample molecules.
[0029] The preferred state of the finished donkey-hide gelatin product to be tested is powder.
[0030] The molecular vibrational fingerprint is a unique spectral feature produced by the interaction of a molecule with light at a specific frequency through the vibration of its internal chemical bonds and structure.
[0031] The energy level transition information is data that includes energy, direction, probability, and energy level identity.
[0032] The spectra used to acquire molecular spectral data can be one or more of near-infrared spectroscopy (NIR), Fourier transform infrared spectroscopy (FT-IR), and surface-enhanced Raman spectroscopy (SERS). The acquired one-dimensional spectral sequence is an intensity-wavenumber / wavelength sequence. Near-infrared and infrared detection enable non-destructive and rapid analysis of solid samples, facilitating online or near-line applications; surface-enhanced Raman can be used as a supplementary characterization method as needed. Near-infrared (NIR), Fourier transform infrared spectroscopy (FT-IR), and surface-enhanced Raman spectroscopy can be used individually or in combination.
[0033] In one embodiment, the near-infrared spectrum is collected in the 4000-9000 nm wavelength range. The infrared spectrum acquisition band is 400-4000. The acquisition wavelength range for surface-enhanced Raman spectroscopy is 600-1700 nm. .
[0034] S2. Based on the acquired raw one-dimensional spectral data, obtain the one-dimensional spectrum of the signal enhancement.
[0035] In one feasible implementation, basic signal processing is performed on the acquired raw one-dimensional spectral data, including removing invalid bands, correcting baseline drift, and eliminating dimensional differences. This reduces the impact of environmental noise and instrument system errors on the deep learning classification and discrimination model. The invalid bands are calculated using the standard deviation threshold method, removing flat, information-free bands (such as background noise regions) with standard deviations close to zero. Based on the spectral type, an appropriate preprocessing algorithm is used to preprocess the spectral data after basic signal processing. For example, for near-infrared and infrared spectra, Z-score normalization is performed to unify the scale; for surface-enhanced Raman spectra, asymmetric least squares (AsLS) is used for baseline correction, combined with Savitzky-Golay (SG) filtering for smoothing and denoising, significantly improving the signal-to-noise ratio.
[0036] S3. Map the one-dimensional spectrum to a two-dimensional spatial layout while maintaining the topological structure to generate a two-dimensional multi-channel feature map.
[0037] Although a one-dimensional spectrum consists of hundreds or thousands of discrete wavelength points, due to the physical continuity of molecular vibrations, adjacent bands or those with the same functional group response often exhibit highly synchronous changes.
[0038] In one feasible implementation, a manifold learning algorithm is used to analyze the intrinsic similarity and correlation between spectral bands or variables. One-dimensional spectral data is mapped to a two-dimensional spatial layout while maintaining the topological structure. The mapped bands are discretized into preset two-dimensional grid pixels, and the corresponding spectral intensity values are filled into the pixel positions, thereby converting the one-dimensional sequence into a two-dimensional multi-channel feature map rich in spatial structure information.
[0039] Manifold learning is a class of nonlinear dimensionality reduction methods used to discover the inherent, low-dimensional "essential" structure within high-dimensional data. It assumes that the high-dimensional data we observe is actually formed by a hidden, lower-dimensional "manifold" that has been complexly twisted (embedded) into the high-dimensional space. For example, the manifold learning algorithm UMAP (Uniform Manifold Approximation and Projection). In this application, the manifold learning algorithm quantifies the nonlinear correlation of these variables in the feature space by constructing a nearest-neighbor graph structure between bands in the high-dimensional space. The algorithm maps these bands that are "close" (i.e., highly correlated) in the high-dimensional space to the neighboring pixel positions of a two-dimensional grid through nonlinear projection. Therefore, the generated two-dimensional feature map is not randomly arranged, but rather an ordered recombination of the intrinsic chemical structure information of the spectrum. This topology-preserving mapping, automatically implemented by the algorithm, allows previously difficult-to-observe weak feature correlations to be presented in the form of spatial texture, thus facilitating the subsequent efficient extraction of key discriminative features related to the quality of donkey-hide gelatin by the convolutional neural network through local receptive fields.
[0040] The two-dimensional multi-channel feature map space can be represented as follows: H is the height, W is the width. This represents the spatial topological arrangement of spectral feature points (wavelength points) in a two-dimensional plane. Manifold learning-based UMAP clusters highly correlated one-dimensional feature points into adjacent pixels. C represents the channel, which is a structured grouping of features determined by the model's training hyperparameters. The manifold learning algorithm divides all feature points into n clusters based on their correlation, with each cluster corresponding to one channel.
[0041] By using feature mapping, one-dimensional spectra are converted into two-dimensional multi-channel feature maps, which facilitates the extraction of multi-scale differential features by convolutional neural networks.
[0042] S4. Based on the two-dimensional multi-channel feature map, a deep learning classification and discrimination model is used to obtain the quality judgment conclusion of the finished product of donkey-hide gelatin.
[0043] Based on spectral acquisition and model inference to output discrimination results, the detection cycle can be significantly shortened, making it suitable for batch release and process monitoring.
[0044] In one feasible implementation, the deep learning classification and discrimination model comprises a convolutional neural network module, a multi-scale feature fusion module (Inception-like), a self-attention feature calibration module (CBAM), and a classification output module. The convolutional neural network module includes basic convolutional layers and pooling layers. After taking a two-dimensional multi-channel feature map as input, the basic convolutional layers and pooling layers extract shallow texture features from the spectral data. One network configuration of the multi-scale feature fusion module includes parallel 1×1, 3×3, and 5×5 multi-size convolutional branches, which fuse features from different receptive fields through channel concatenation. The multi-scale feature fusion module aims to simultaneously capture response peak features of varying widths in the spectrum, such as narrow peaks corresponding to specific functional groups and broad peaks corresponding to hydrogen bond associations. The self-attention feature calibration module helps to enhance the contribution of key bands and suppress redundant information, generating spatial attention maps and channel attention maps. By dynamically weighting the multi-scale features, it automatically suppresses interference from background noise regions (invalid bands) and significantly enhances the feature weights of key physicochemical fingerprint regions. The output module is connected after the attention feature calibration module. The classification output module consists of a global pooling layer (Global MaxPool) and a fully connected layer, outputting a quality judgment conclusion for the finished donkey-hide gelatin product. The conclusion includes at least the grade category, brand affiliation, or abnormal condition of the donkey-hide gelatin. The grade category can be, for example, superior, first-grade, second-grade, etc.; the abnormal condition can be, for example, adulterated, or spoiled, and can be set as needed.
[0045] The deep learning classification and discrimination model is trained according to the spectral type. After training, the model weights and parameters corresponding to near-infrared spectroscopy, Fourier transform infrared spectroscopy, and surface-enhanced Raman spectroscopy are obtained respectively. During inference, the corresponding model weights and parameters are loaded according to the spectral type. Specifically, during training, molecular spectral data corresponding to the near-infrared spectrum, Fourier transform infrared spectrum, and surface-enhanced Raman spectrum of donkey-hide gelatin are obtained, and corresponding quality classifications of donkey-hide gelatin products are designed for each. First, the deep learning classification and discrimination model is trained using the two-dimensional multi-channel image corresponding to the near-infrared spectral data of donkey-hide gelatin, and the trained deep learning classification and discrimination model is used as the near-infrared spectral model. Then, the two-dimensional multi-channel image corresponding to the Fourier transform infrared spectrum is used to train the deep learning classification and discrimination model with the same structure, and the trained deep learning classification and discrimination model is used as the infrared spectral model. Finally, the two-dimensional multi-channel image corresponding to the surface-enhanced Raman spectrum is used to train the deep learning classification and discrimination model, and the trained deep learning classification and discrimination model is used as the Raman spectral model. The weights and parameters of the three models are stored. During inference, based on the selected quality classification of the donkey-hide gelatin product, corresponding weights and parameters are loaded onto the deep learning classification model. In this implementation, only one model structure needs to be deployed to achieve classification judgments using three models. Furthermore, the usage can be optimized by using the near-infrared spectroscopy model as the primary detection model. When additional load and auxiliary interpretation are needed, the weights and parameters of the infrared model are loaded; when auxiliary identification is required, the Raman spectroscopy model is loaded, eliminating the need to deploy three models simultaneously. This lightweight model deployment enables rapid screening and can meet diverse detection needs, balancing efficiency and reliability.
[0046] An optimized deep learning classification and discrimination model, designed for complex quality control needs, features multi-task decision-making logic. It employs a "unified model with multiple output heads" architecture, sharing a feature extraction backbone network and setting independent Softmax multi-classification or binary classification heads at the ends, corresponding to grade, brand, and anomaly detection tasks, respectively. Within the same overall framework, it can achieve grade discrimination, brand recognition, and anomaly sample identification, and can be flexibly configured through a multi-task model or a multi-model approach, improving the efficiency of quality inspection of donkey-hide gelatin products.
[0047] An optimized deep learning classification and discrimination model is proposed to address complex quality control needs by implementing hierarchical discrimination or comprehensive decision-making strategies. It can employ a sequential hierarchical approach, first screening samples for color anomalies or excessive water-insoluble matter using an anomaly detection head, and then further subdividing them by grade and brand after determining their compliance. Alternatively, it can use a parallel output approach, combining the confidence levels of multiple output heads, with the decision module generating final release, review, or warning instructions, which are then written into the quality management system for product traceability.
[0048] Based on the above-mentioned methods for quality testing of donkey-hide gelatin products, a quality testing system for donkey-hide gelatin products is implemented, such as... Figure 1 As shown. The system deployment includes: first, deploying a spectral acquisition terminal, including a high-precision near-infrared spectrometer and a compatible probe (diffuse reflectance / transmission mode), responsible for scanning donkey-hide gelatin powder and acquiring raw spectral signals in real time. Then, deploying a data processing and AI inference platform, which includes a memory and a processor. This platform embeds a mapping engine, stores band topological distribution parameters, and uses a trained CNN model to perform real-time one-dimensional to two-dimensional conversion, outputting a two-dimensional multi-channel feature map for model classification; simultaneously, it loads a trained deep learning classification and discrimination model to perform inference calculations on the two-dimensional multi-channel feature map, outputting classification results, enabling offline laboratory analysis or online production line testing.
[0049] In the quality inspection of finished donkey-hide gelatin products in this plan, the data flow involved is as follows: Figure 2 As shown, molecular spectral data obtained by scanning donkey-hide gelatin powder undergoes basic signal processing and data preprocessing. Based on the signal-to-noise ratio enhanced molecular spectral data of donkey-hide gelatin powder, manifold learning is used for manifold embedding, and feature aggregation is achieved based on the intrinsic similarity and correlation between spectral bands or variables, outputting a two-dimensional multi-channel feature map. The two-dimensional channel feature map is input into a deep learning classification and discrimination model, and sequentially passes through a convolutional layer (2 layers) and a max pooling layer (1 layer) to obtain outputs of three sizes: 1×1, 3×3, and 5×5. These three sizes are concatenated through feature stitching, and the multi-scale features are dynamically weighted through a self-attention layer to automatically suppress the interference of background noise regions (invalid bands). After processing by a max pooling layer to retain important features while reducing data dimensionality, the donkey-hide gelatin classification is output by a fully connected layer.
[0050] Figure 3 This is a comparison chart of the classification accuracy of the proposed method (AggMap) with other traditional models in the brand classification task. As can be seen from the chart, the accuracy of the proposed method is significantly higher than that of other models.
[0051] In summary, this application proposes a method for quality detection of donkey-hide gelatin products. The method maps the one-dimensional molecular spectral data of the donkey-hide gelatin products into two-dimensional multi-channel images using manifold learning. Based on the multi-channel images, feature mapping deep learning is performed to obtain a quality classification judgment for the donkey-hide gelatin products. Accordingly, a quality detection system for donkey-hide gelatin products can be implemented. The system includes: a mapping module configured to map the one-dimensional molecular spectral data of the donkey-hide gelatin products into two-dimensional multi-channel images using manifold learning; and a deep learning classification and discrimination model module configured to perform feature mapping deep learning based on the multi-channel images to obtain a quality classification judgment for the donkey-hide gelatin products.
[0052] Additionally, a computer program product may be obtained, which may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the method or system of the present invention.
[0053] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0054] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0055] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, Python, etc., and conventional procedural programming languages such as "C" or similar languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0056] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0057] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0058] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0059] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0060] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.
Claims
1. A method for quality testing of finished donkey-hide gelatin products, characterized in that, One-dimensional molecular spectral data of donkey-hide gelatin products are mapped into two-dimensional multi-channel images using manifold learning. Based on the multi-channel images, feature mapping deep learning is performed to obtain quality classification of donkey-hide gelatin products.
2. The method according to claim 1, characterized in that, The spectra used to obtain the one-dimensional molecular spectral data of the finished donkey-hide gelatin product are one or more of the following: near-infrared spectroscopy, Fourier transform infrared spectroscopy, and surface-enhanced Raman spectroscopy.
3. The method according to claim 2, characterized in that, The near-infrared spectroscopy acquisition band is 4000-9000. The infrared spectrum acquisition band is 400-4000. The acquisition wavelength range for surface-enhanced Raman spectroscopy is 600-1700 nm. .
4. The method according to claim 1, characterized in that, Before mapping, the one-dimensional molecular spectral data of the finished donkey-hide gelatin product undergoes basic signal processing and data preprocessing. The basic signal processing includes removing invalid bands, correcting baseline drift, and eliminating dimensional differences. The data preprocessing includes performing Z-score normalization on near-infrared and infrared spectra to unify the scale, using an asymmetric least squares algorithm for baseline correction on surface-enhanced Raman spectra, and combining Savitzky-Golay filtering algorithm for smoothing to improve the signal-to-noise ratio.
5. The method according to claim 1, characterized in that: The feature mapping deep learning is implemented using a deep learning classification and discrimination model. The deep learning classification and discrimination model is trained according to the spectral type. After training, the model weights and parameters corresponding to near-infrared spectrum, Fourier transform infrared spectrum, and surface-enhanced Raman spectrum are obtained respectively. During inference, the corresponding model weights and parameters are loaded according to the spectral type. The deep learning classification and discrimination model includes a convolutional neural network module, a multi-scale feature fusion module, a self-attention feature calibration module, and a classification output module; The convolutional neural network module is configured to take a multi-channel image as input and use convolutional and pooling layers to extract multi-scale shallow texture features of donkey-hide gelatin from the spectral data. The multi-scale feature fusion module is configured to merge the shallow texture features of donkey-hide gelatin of multiple sizes through channel splicing, so as to simultaneously capture response peak features of varying widths in the spectrum. The self-attention module is configured to dynamically weight based on splicing and fusion of multi-scale features to automatically suppress noise interference; The classification output module is configured to perform dimensionality reduction processing on the weighted features through a max pooling layer, and then output the quality classification of the donkey-hide gelatin product using a fully connected layer.
6. The method according to claim 1, characterized in that, The mapping step includes: The one-dimensional molecular spectral data of the finished donkey-hide gelatin product is mapped to a two-dimensional spatial layout while maintaining the topological structure; The mapped bands are discretized into preset two-dimensional grid pixels, and the corresponding spectral intensity values are filled into the pixel positions, thereby converting the one-dimensional molecular spectral sequence into a two-dimensional multi-channel image.
7. The method according to claim 1, characterized in that, The quality classification of the finished donkey-hide gelatin product includes the following: authenticity of one or more types of donkey-hide gelatin, brand of donkey-hide gelatin, grade of donkey-hide gelatin, whether the color of donkey-hide gelatin is abnormal, and whether the content of water-soluble matter exceeds the standard.
8. A quality inspection system for finished donkey-hide gelatin products, characterized in that, The system includes a spectral acquisition terminal, a memory, and a processor; the acquisition terminal includes a near-infrared spectrometer and an adapter probe, and the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer program is stored that can be loaded by a processor and executed according to any one of claims 1 to 7.
10. A quality inspection system for finished donkey-hide gelatin products, characterized in that, The system includes: The mapping module is configured to map the one-dimensional molecular spectral data of the finished donkey-hide gelatin product into a two-dimensional multi-channel image using manifold learning; The deep learning classification and discrimination model module is configured to perform feature mapping deep learning based on multi-channel images to obtain the quality classification judgment of donkey-hide gelatin products.