A fiber raw material traceability method and system based on big data
By combining the Internet of Things and blockchain technology, and using an improved convolutional neural network to generate comprehensive feature vectors, intelligent traceability and quality monitoring of fiber raw materials are realized, which solves the problems of data fragmentation and easy tampering in the traceability and quality monitoring of fiber raw materials, and improves traceability transparency and monitoring efficiency.
Patent Information
- Application Number
- CN202411965227.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-12-30
AI Technical Summary
There are problems in the traceability and quality monitoring of fiber raw materials, such as data fragmentation, easy tampering and lack of intelligence. Existing technologies make it difficult to achieve full-process traceability and efficient quality monitoring, especially in the case of multi-national supply chains, where information acquisition and verification are difficult.
IoT devices are used to collect multi-source data, and comprehensive feature vectors are generated through improved convolutional neural networks. Blockchain technology is combined with encrypted storage and real-time query to achieve intelligent and real-time traceability and quality monitoring of fiber raw materials.
It improves traceability transparency, data security and monitoring efficiency, supports multi-source data fusion, meets supply chain transparency needs, reduces management costs, and improves quality assessment efficiency and accuracy.
Smart Images

Figure CN119904247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a fiber raw material traceability method and system based on big data. Background Art
[0002] Fiber raw materials (such as wool, linen, silk, etc.) are important basic materials for the textile industry. Their quality and source have a significant impact on the performance and market competitiveness of the final product. However, the traceability and quality monitoring of fiber raw materials in the current textile industry face many challenges, which are mainly reflected in the following aspects: Supply chain complexity. The production and circulation of fiber raw materials involve multiple links, including raw material collection, transportation, processing and storage. Due to the long supply chain chain, the fragmentation of information between each link often makes it difficult to trace the source and quality of the product. For example, a batch of wool may pass through multiple middlemen, and the path from the place of origin to the final textile factory is complex. The lack of a unified recording mechanism can easily lead to information loss or tampering. In addition, the quality recording methods of different links vary, making it difficult to form a unified traceability system.
[0003] Currently, fiber raw material traceability relies primarily on traditional methods such as barcodes, labels, or manual record-keeping. These methods present the following challenges: Tamperability: Barcode labels are easily forged or tampered with, making it difficult to ensure data authenticity. Lack of real-time performance: Manual record-keeping relies on manual intervention, resulting in delayed data uploads and uncertain accuracy. Single data source: Traditional traceability methods often only record batch numbers or simple origin information, neglecting multi-dimensional data such as environmental conditions and transportation status, resulting in incomplete traceability information.
[0004] The quality assessment of fiber raw material parameters usually relies on manual inspection or laboratory testing, which is not only costly but also inefficient. In addition, manual inspection is easily affected by subjective factors, and different inspectors may have different assessments of the same batch of raw materials. Existing quality assessment methods lack automated and intelligent analysis methods for fiber morphology (such as curl, length, color, etc.). The potential of blockchain technology in traceability has not been fully utilized. Blockchain technology, with its advantages such as decentralization, data immutability and traceability, provides new ideas for supply chain traceability. However, in the field of fiber raw materials, the application of blockchain technology is still in its early stages. The main problems include: Insufficient integration of data collection and blockchain: Existing blockchain traceability solutions mostly focus on data storage, and lack effective integration of data collection and processing. Performance bottleneck: The processing speed and storage capacity of blockchain technology limit its application in large-scale supply chains.
[0005] Artificial intelligence technology (such as convolutional neural networks) has broad application prospects in the fields of image recognition and data analysis, but its potential has not yet been fully tapped in the quality monitoring of fiber raw materials. For example, morphological parameters such as fiber curl, length and color characteristics can be automatically extracted through image data, but the existing industry lacks intelligent analysis methods for these parameters. In addition, the fusion and collaborative processing capabilities between different data sources (such as image data, sensor data and unique identification) are insufficient, resulting in a low level of intelligence in traceability and quality assessment. Moreover, in the existing technology, the geographical factors of fiber raw materials are not fully considered when training convolutional neural networks, resulting in inaccurate identification.
[0006] As consumers demand higher quality and sustainability, the market is increasingly demanding transparency in the traceability of fiber raw materials. For example, in the high-end textile sector, consumers are paying more attention to the origin and production process of products, hoping to understand whether the raw materials are sourced from high-quality sources and meet environmental and ethical standards. However, existing traceability systems struggle to meet these demands, especially when multinational supply chains are involved, making information acquisition and verification particularly challenging.
[0007] In summary, existing technologies are unable to effectively address the issues of fiber raw material traceability and quality monitoring. Therefore, a new approach is urgently needed that comprehensively leverages the Internet of Things, big data, artificial intelligence, and blockchain technologies to build a comprehensive traceability system from raw material collection to terminal query. This approach also aims to enhance fiber raw material quality monitoring capabilities through multi-source data fusion and intelligent analysis. This present invention addresses these issues, aiming to achieve intelligent, real-time, and efficient fiber raw material traceability, providing an innovative solution for the textile industry.
[0008] Therefore, there is an urgent need for a fiber raw material traceability method based on big data to achieve large-scale, accurate fiber material traceability and identification. This invention, by introducing an improved convolutional neural network, addresses existing issues such as incomplete data collection, insufficient feature extraction, and low model accuracy. This provides a scientific basis and technical support for fiber raw material traceability, and has significant practical application value and widespread application prospects. Summary of the Invention
[0009] In response to the above-mentioned problems mentioned in the prior art and to address the above-mentioned technical issues, the present invention provides a fiber raw material traceability method and system based on big data, comprising: utilizing Internet of Things devices to collect multi-source data on raw materials, including image data, sensor data, and unique identifiers; standardizing the collected data and combining them to generate a comprehensive feature vector; inputting the comprehensive feature vector into an improved convolutional neural network to output fiber raw material parameters, including curl, length, color characteristics, region, and production time; encrypting and storing the traceability information using blockchain technology; and enabling users to retrieve and display fiber raw material parameters in real time through a query module. By introducing big data analysis and blockchain technology, the present invention addresses the problems of data fragmentation, susceptibility to tampering, and lack of intelligence in existing fiber raw material traceability and quality monitoring methods, significantly improving traceability transparency, data security, and monitoring efficiency, making it suitable for supply chain management and quality control in the textile industry.
[0010] A fiber raw material traceability method based on big data, comprising the steps of:
[0011] S1: Collect multi-source data of fiber raw materials, including image data, sensor data, and unique identification;
[0012] S2: compresses image data into a standardized JPEG format, encodes sensor data into JSON format, normalizes unique identifiers to generate standardized strings, and combines the processed data to generate a comprehensive feature vector;
[0013] S3: Input the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs fiber raw material parameters, which include the curliness of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is:
[0014]
[0015] Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, with a value range of [0,1]; K is the total number of categories; category k is the province where each fiber raw material sample is located, determined by its GPS coordinates. Fiber raw material samples are divided by province, with each province corresponding to a category k;
[0016] S4: Use blockchain technology to encrypt and store traceability information to ensure that the data cannot be tampered with; establish a distributed database in the cloud to store all traceability information for quick access and analysis: traceability information includes collected multi-source data and fiber raw material parameters;
[0017] S5: When the user queries, the fiber raw material parameters in the blockchain are retrieved and displayed through the terminal, and the information is sent to the customer terminal.
[0018] Preferably, the sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp, and batch number; the location information, timestamp, ambient temperature, and humidity during the transportation of raw materials are collected; and the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
[0019] Preferably, the method of using blockchain technology to encrypt and store the collected multi-source data includes: formatting the collected multi-source data, that is, storing the image data in a standardized JPEG format, storing the sensor data in a JSON format, encoding the unique identity identifier to form a standardized string; encrypting the formatted data by using the SHA-256 hash algorithm to generate a hash value of a fixed length; storing the encrypted data records in the blockchain, and verifying the legitimacy of the new block through a proof-of-work consensus mechanism; and updating the distributed ledgers of all nodes to ensure that the data cannot be tampered with.
[0020] Preferably, the processed data is combined to generate a comprehensive feature vector, including: using a color histogram to extract color distribution features of the image data, a grayscale co-occurrence matrix to extract texture features, an edge detection algorithm to extract edge features, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
[0021] Preferably, the y' i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows:
[0022]
[0023] Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
[0024] This application also provides a fiber raw material traceability system based on big data, including:
[0025] Data acquisition module, collects multi-source data of fiber raw materials, including image data, sensor data, and unique identification;
[0026] A comprehensive vector generation module compresses image data into a standardized JPEG format, encodes sensor data into JSON format, normalizes unique identifiers to generate standardized strings, and combines the processed data to generate a comprehensive feature vector;
[0027] The fiber raw material parameter recognition module inputs the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs the fiber raw material parameters, which include the curvature of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is:
[0028]
[0029] Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, with a value range of [0,1]; K is the total number of categories; category k is the province where each fiber raw material sample is located, determined by its GPS coordinates. Fiber raw material samples are divided by province, with each province corresponding to a category k;
[0030] The blockchain data storage module uses blockchain technology to encrypt and store traceability information to ensure that the data cannot be tampered with. A distributed database is established in the cloud to store all traceability information for quick access and analysis. The traceability information includes collected multi-source data and fiber raw material parameters.
[0031] In the query module, when the user queries, the fiber raw material parameters in the blockchain are retrieved and displayed through the terminal, and the information is sent to the customer terminal.
[0032] Preferably, the sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp, and batch number; the location information, timestamp, ambient temperature, and humidity during the transportation of raw materials are collected; and the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
[0033] Preferably, the method of using blockchain technology to encrypt and store the collected multi-source data includes: formatting the collected multi-source data, that is, storing the image data in a standardized JPEG format, storing the sensor data in a JSON format, encoding the unique identity identifier to form a standardized string; encrypting the formatted data by using the SHA-256 hash algorithm to generate a hash value of a fixed length; storing the encrypted data records in the blockchain, and verifying the legitimacy of the new block through a proof-of-work consensus mechanism; and updating the distributed ledgers of all nodes to ensure that the data cannot be tampered with.
[0034] Preferably, the processed data is combined to generate a comprehensive feature vector, including: using a color histogram to extract color distribution features of the image data, a grayscale co-occurrence matrix to extract texture features, an edge detection algorithm to extract edge features, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
[0035] Preferably, the y' i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k ; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows:
[0036]
[0037] Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
[0038] The present invention provides a fiber raw material traceability method and system based on big data, which can achieve the following beneficial technical effects:
[0039] 1. This invention utilizes IoT devices to collect multi-source data on raw materials, including image data, sensor data, and unique identifiers. The collected data is standardized and combined to generate a comprehensive feature vector. This comprehensive feature vector is then input into an improved convolutional neural network to output fiber raw material parameters, including curl, length, color characteristics, region, and production time. This traceability information is encrypted and stored using blockchain technology. Users can retrieve and display fiber raw material parameters in real time through a query module. By incorporating big data analysis and blockchain technology, this invention addresses the issues of data fragmentation, susceptibility to tampering, and lack of intelligence found in existing fiber raw material traceability and quality monitoring methods. This significantly improves traceability transparency, data security, and monitoring efficiency, making it suitable for supply chain management and quality control in the textile industry.
[0040] 2. The present invention collects multi-source data of fiber raw materials during production, transportation and storage through Internet of Things devices, including image data, sensor data and unique identity information, and builds a full-process traceability system covering the raw material collection site to the end user. Users can query detailed information such as the origin, production environment, and transportation route of raw materials in real time, meeting the needs of consumers and enterprises for supply chain transparency. It supports multi-source data fusion, improves the comprehensiveness of traceability and quality monitoring, generates comprehensive feature vectors through the fusion processing of image data, sensor data and unique identity information, comprehensively analyzes the multi-dimensional information that affects the quality of fiber raw materials, and constructs a multi-dimensional quality traceability model, which solves the limitations of traditional single data source monitoring methods.
[0041] 3. This invention leverages blockchain technology to ensure data authenticity and immutability. Collected multi-source data is formatted and encrypted before being stored on the blockchain. Leveraging blockchain's decentralized and distributed ledger nature, this ensures the authenticity and immutability of traceability data, effectively preventing information falsification within the supply chain and enhancing data credibility. 6. Through blockchain's distributed storage and automated intelligent analysis, this invention reduces the workload of manual recordkeeping and repeated checks, significantly improving supply chain management efficiency while also reducing enterprise management costs.
[0042] 4. This invention incorporates artificial intelligence algorithms to achieve intelligent analysis of quality parameters. By processing comprehensive feature vectors through an improved convolutional neural network and incorporating weights assigned to fiber raw material categories into training considerations, this method effectively addresses the issue of unbalanced data distribution and significantly enhances the classification model's ability to identify small sample categories. This method intelligently extracts quality parameters such as curl, length, and color characteristics of fiber raw materials, replacing traditional manual inspection methods. This significantly improves the efficiency and accuracy of quality assessments and reduces subjective errors caused by human factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 This is a schematic diagram of the steps of a fiber raw material traceability method based on big data of the present invention;
[0045] Figure 2 This is a fiber raw material traceability system diagram based on big data of the present invention. DETAILED DESCRIPTION
[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0047] Example 1:
[0048] In order to solve the above-mentioned technical problems mentioned in the prior art, the following Figure 1 As shown: A fiber raw material traceability method based on big data, comprising the following steps:
[0049] S1: Collect multi-source data of fiber raw materials, which include: image data, sensor data, and unique identification. In one embodiment, the image data acquisition device is: a high-definition camera (resolution not less than 1920x1080) is installed at the wool shearing station of the ranch. The acquisition method is to collect real-time images of the appearance of the wool of each sheep during the wool shearing process. The color, curl and surface condition (such as gloss, stains, etc.) of the wool are photographed. The collected raw image data is compressed into a standardized JPEG format, and each image is bound to the unique identification of the batch of wool.
[0050] Sensor Data Collection Equipment: The following sensors are deployed on the farm and transport vehicles: Ambient temperature and humidity sensors: Monitor the ambient temperature and humidity during shearing in real time (e.g., temperature 22°C, humidity 65%). Light intensity sensors: Record the light intensity during shearing (e.g., light intensity 1000 lux). GPS positioning devices: Record the geographic coordinates of the wool's location on the farm and during transport (e.g., latitude 34.0522, longitude 108.9370). Collection Method: At the shearing station, sensors record shearing environmental data in real time. During transport, sensors on the vehicle automatically collect location and environmental data every 10 minutes. Storage: Sensor data is stored in JSON format, containing the following information: Ambient temperature (unit: °C): 22; Ambient humidity (unit: %): 65; Light intensity (unit: lux): 1000; GPS coordinates: latitude 34.0522, longitude 108.9370; timestamp: 2023-12-26T10:30:00Z. Unique ID, Generation Method: Each sheep's wool is assigned a unique RFID tag (RFID number RF123456). The tag contains the following information: Origin: A ranch in Shaanxi Province; Cutting Time: December 26, 2024, 10:30 AM; Batch Number: Batch001; Binding Method: The RFID tag is associated with the wool's image data and sensor data. RFID Number: RF123456; Image File Name: RF123456.jpg; JSON Data File Name: RF123456.json
[0051] Data storage and transmission: All collected data is transmitted to the cloud server via the IoT gateway. Data organization: Image data is stored in a designated image database. Sensor data and unique identifiers are stored in a JSON database and associated with the image data file name.
[0052] In one embodiment, multi-source data collection for hemp fiber raw materials is performed. Image data collection equipment: High-definition industrial cameras are installed on the production lines of a hemp fiber processing plant. During the hemp fiber separation process, images of fiber length and uniformity are recorded. Ten random sample images are collected for each batch of hemp fiber. Storage: Compressed into standardized JPEG format and associated with the unique identifier of the hemp fiber batch. Sensor data collection equipment: The following sensors are deployed in the hemp fiber separation workshop: Temperature and humidity sensors: Monitor the processing environment. Vibration sensors: Record the vibration status of processing equipment. GPS positioning devices: Record the geographic location of the processing workshop. Environmental sensors in the processing workshop record temperature and humidity data in real time. Vibration sensors collect equipment operating data every minute to determine if processing is abnormal. Storage: Data is stored in JSON format, for example: Ambient temperature: 25°C; Ambient humidity: 55%; Equipment vibration value (unit: g): 0.5; GPS coordinates: Latitude 31.2304, Longitude 121.4737; Timestamp: 2024-12-26T14:15:00Z. Unique ID Generation Method: A QR code label is generated for each batch of hemp fiber. The label includes: Origin: a processing plant; Processing time: December 26, 2024, 2:15 PM; Batch number: Batch002; Data storage and transmission. Image and sensor data are uploaded to the processing plant's data management system via an Industrial IoT gateway. The QR code label is then linked to all data for that batch of hemp fiber.
[0053] S2: Image data is compressed into a standardized JPEG format, sensor data is encoded in JSON format, unique identifiers are normalized to generate a standardized string, and the processed data are combined to generate a comprehensive feature vector. In one embodiment, image data processing involves raw data acquisition, using a high-definition camera to capture the wool's appearance characteristics, including color, surface gloss, and curl. Each image is in RAW format with a resolution of 4000x3000 pixels. Data Processing: Image data is large, making direct storage and analysis inefficient for subsequent processing. Therefore, compression is required. The raw image files are compressed into JPEG format and the resolution is adjusted to 1920x1080 pixels to ensure a small file size and adequate image quality. Each image file is assigned a unique file name corresponding to the unique identifier. The target result image files are standardized to facilitate subsequent data analysis and storage. Each batch of wool image files is associated with its RFID tag. Sensor data processing involves raw data acquisition, using environmental sensors to collect real-time temperature, humidity, and light intensity data during shearing. GPS equipment is used to collect the latitude and longitude of the shearing location. Data examples include: temperature: 22.4°C, humidity: 65%, light intensity: 800 lux, GPS latitude and longitude: 34.0522 (latitude), 108.9370 (longitude). Data encoding: All sensor data is encoded in a standard JSON format to facilitate association with image data and unique identifiers. Unique identifiers process raw data collection. Each batch of wool is assigned a unique identifier, which is stored on an RFID tag. The unique identifier includes the following: RFID number: RF123456, origin: a ranch in Shaanxi Province, harvesting time: December 26, 2024, 10:30 AM, batch number: Batch001. Data processing: This information is concatenated into a standardized string. To ensure security and uniformity, a standard encoding method (such as the SHA algorithm) is used to convert the concatenated string into a fixed-format hash value. Target outcome: Generate a unique identifier string or hash value that corresponds to each batch of wool data. To generate a comprehensive feature vector, the data is combined with image data (such as image file name or extracted features), sensor data (encoded in JSON format), and a unique identifier (encoded string) in a fixed order. The target form combines the above data into a comprehensive feature vector, for example: Image feature vector: color distribution, texture features, etc. (key information extracted from the image). Sensor data feature vector: ambient temperature, humidity, light intensity, and GPS coordinates. Unique identifier feature vector: encoded unique identifier. The comprehensive feature vector is a unified data input, formatted as a data object with a fixed structure, which is convenient for subsequent convolutional neural network or other analysis modules to process.
[0054] S3: Input the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs fiber raw material parameters, which include the curliness of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is:
[0055]
[0056] Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, with a value range of [0, 1]; K is the total number of categories; category k is the province determined by the GPS coordinates of each fiber raw material sample, and the fiber raw material samples are divided by province, with each province corresponding to one category k. In one embodiment, the structure of a convolutional neural network includes an input layer: the input is a comprehensive feature vector, including image features, sensor features, and unique identifier features. For example: Image features: 271 dimensions (color, texture, edge information). Sensor features: 5 dimensions (temperature, humidity, light intensity, GPS information). Unique identifier features: 32 dimensions (encoded hash value). The total dimension of the comprehensive feature vector is 308 dimensions. Convolution layer: The comprehensive feature vector is processed using multiple sets of convolution kernels (e.g., 32 3x1 kernels) to extract local patterns of high-dimensional features. The convolution operation can identify specific patterns or correlations, such as the potential relationship between image features and sensor features. Pooling layer: Pooling operations (e.g., max pooling) are applied to the convolved feature map to further reduce dimensionality and redundant information. The main function of the pooling layer is to retain important features while reducing data dimensionality and improving computational efficiency. Fully connected layer: The feature maps after convolution and pooling are flattened into a one-dimensional feature vector and passed to the fully connected layer. The fully connected layer comprehensively analyzes the features using a weight matrix to generate predicted values for each output parameter. Output layer: The output layer consists of multiple neurons, each corresponding to a target parameter: Curl prediction: Continuous value output (e.g., 0.1 to 1.0). Fiber length prediction: Continuous value output (e.g., 20 to 100 mm). Color feature: Multi-category classification output (e.g., white, gray, brown). Region prediction: Multi-category classification output (e.g., Shaanxi, Inner Mongolia, Xinjiang, etc.). Time of generation: Time range classification output (e.g., morning, afternoon, evening). Loss function: A class-weighted cross entropy loss function is used to optimize classification tasks (e.g., color, region, and time of generation). A mean squared error loss function is used for continuous value prediction tasks (e.g., curl, length).
[0057] The working principle of a convolutional neural network: Data input: A comprehensive feature vector serves as the network input and enters the convolutional layer for processing. Image features provide visual characteristics of the fiber, sensor features reflect environmental conditions, and unique identifiers ensure the uniqueness of each data entry. Feature extraction: The convolutional layer identifies local patterns in the comprehensive feature vector, such as correlations between image and sensor features. Stacking multiple layers of convolutions progressively extracts high-level semantic features. For example, Convolution 1 identifies color and texture patterns. Convolution 2 analyzes the potential impact of environmental conditions on the fiber's appearance. Feature dimensionality reduction: The pooling layer reduces the dimensionality of the convolved features, preserving important information while reducing computational effort. Feature fusion: The fully connected layer flattens the reduced feature map into a one-dimensional vector. Features from different sources are combined and analyzed in the fully connected layer to generate a high-dimensional feature representation. Output prediction: The output layer predicts various fiber parameters based on the analysis results of the fully connected layer. Classification tasks use the Softmax function to generate probability distributions for each class, while numerical prediction tasks output continuous values. Model optimization: The model is optimized using training data, and the network parameters are updated using the backpropagation algorithm. During the training process, the category weights in the loss function are dynamically adjusted to solve the problem of uneven sample distribution.
[0058] Input data image features: The color distribution of a batch of wool is light white, with high curl and uniform edge texture. Sensor features: The ambient temperature at the time of shearing is 22°C, the humidity is 65%, the light intensity is 800 lux, and the GPS location is in Shaanxi. Unique identification: The corresponding RFID number is RF123456. Predicted output: Curl: The predicted value is 0.85 (high curl). Length: The predicted value is 55 mm (medium length). Color features: Predicted to be "white" category with a probability of 98%. Region: Predicted to be "Shaanxi" category with a probability of 95%. Generation time: Predicted to be "afternoon" category with a probability of 89%.
[0059] S4: Blockchain technology is used to encrypt and store traceability information, ensuring that the data cannot be tampered with. A distributed database is established in the cloud to store all traceability information for quick access and analysis. Traceability information includes collected multi-source data and fiber raw material parameters. In one embodiment, the blockchain structure consists of blocks: Each block stores traceability information for a batch of fiber raw materials, including the following: hash values of multi-source data (such as image data, sensor data, and unique identifiers); hash value of the previous block (used to link blocks); timestamp (recording the generation time of the block); block number and traceability data summary (briefly summarizing the data content). Chain structure: Blocks form a chain structure through their hash values and the hash value of the previous block. Each block is closely linked to the previous block, forming an unalterable blockchain. For example: Block 1: records the traceability information of wool batch 001, including its hash value. Block 2: records information on wool batch 002, including its own hash value and the hash value of block 1. Distributed storage: The blockchain is stored on multiple nodes, and all nodes have a complete copy of the blockchain. Nodes include corporate headquarters, processing plants, and supply chain partners. The working principle of blockchain, data encryption: After collecting multi-source data on wool, the system formats the data (such as JPEG, JSON encoding). The formatted data is generated into a hash value of fixed length through an encryption algorithm (such as SHA-256). The hash value is the unique identifier of the data and is used to verify the integrity and authenticity of the data. Block generation: The system generates a new block for each batch of fiber raw materials. The block content includes: Hash value: records the summary of the batch data. The hash value of the previous block: ensures the continuity of the blockchain. Timestamp: records the specific time when the block is generated. Block number: identifies the order of the block in the chain. For example: Block number: Block002; Timestamp: December 26, 2024, 10:30 AM; Current block hash value: abc123…; Previous block hash value: xyz789…; Data summary: Multi-source data hash for wool batch 002; Consensus mechanism: The system uses a Proof of Work (PoW) consensus mechanism to verify the legitimacy of new blocks. Each node must verify through computation whether the hash value of the new block meets specific rules. Once verified, all nodes synchronously update the blockchain. Data storage: Newly generated blocks are stored in each node's copy of the blockchain, ensuring distributed data storage. Data queries can be performed by simply searching the blockchain from any node. Data query: The user enters a unique identifier (such as an RFID number) through the query interface, and the system locates the corresponding block. After verifying the data integrity, the system extracts the multi-source data and fiber parameters from the block and returns them to the user. During the storage process, the traceability information for a batch of wool (batch number: Batch002) is as follows: Image data: The hash value of the JPEG file. Sensor data: Hash value of data in JSON format. Unique identifier: Hash value of RFID number.System-generated block content: Block number: Block002; Current block hash value: e1a3d…; Previous block hash value: d9c5b…; Data summary: {"Image Hash": "abc123", "Sensor Hash": "xyz456", "RFID Hash": "pqr789"}; Timestamp: 2024-12-26T10:30:00Z; During the query process, the user searches for traceability information for batch number Batch002. The system searches the blockchain and finds the block associated with Batch002. The multi-source data hash values in the block are extracted and decoded into user-readable information: Image: Wool color is "light white." Sensor: Cutting temperature is 22.4°C, humidity is 65%. Unique identifier: Origin is "a ranch in Shaanxi Province."
[0060] S5: When a user queries, the fiber raw material parameters in the blockchain are retrieved and displayed on the terminal, and the information is sent to the client terminal. In one embodiment, the query process includes query initiation: the user accesses the fiber raw material traceability system through a smart terminal (such as a mobile phone, computer, or tablet) and enters specified query criteria. For example: Criteria 1: Unique ID (such as RFID number RF123456). Criteria 2: Batch number (such as Batch002). After the query is initiated, the system sends the request to the blockchain node. Blockchain retrieval: Based on the entered query criteria, the system scans each block in the blockchain, searching for matching traceability information. Search basis: If the RFID number is entered, the system compares the data summary field in each block to find the block corresponding to RF123456. If the batch number is entered, the system locates the block based on the association between the unique ID and the batch number. Data verification: After retrieving the target block, the system verifies the data hash value in the block to ensure that the data has not been tampered with. Verification method: The hash value in the block is decoded and compared with the hash value recalculated from the original collected data. If verification is successful, the data is proven to be authentic; if verification fails, the system issues a warning. Parameter extraction: Extracts key information about the fiber raw material from the target block, including: Image features: Color and curl of the wool appearance image. Sensor data: Temperature at the time of shearing (22.4°C), humidity (65%), light intensity (800 lux), GPS location (a ranch in Shaanxi Province). Unique identification: RFID number RF123456, generated at 10:30 on December 26, 2024. Data display: The system displays the extracted fiber parameters and traceability information in a structured manner on the user terminal. Displayed content: Batch number: Batch002RFID; ID: RF123456; Color: Light White; Curl: High; Length: 55 mm; Temperature: 22.4°C; Humidity: 65%; Light intensity: 800 lux; Origin: A ranch in Shaanxi Province; Cutting time: December 26, 2024, 10:30 AM. Users can view specific parameter values and verify origin and quality information. Data transmission: The system sends query results to the client terminal (such as the corporate customer's management system) via an encrypted network channel. The data is formatted in JSON or XML for easy reception and further processing by the client system. Corporate customers can directly use this data for quality traceability, supply chain management, or customer service.
[0061] In some embodiments, the sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record the ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp and batch number; the location information, timestamp, ambient temperature and humidity during the transportation of raw materials are collected; the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
[0062] In some embodiments, the encrypted storage of collected multi-source data using blockchain technology includes: formatting the collected multi-source data, namely, storing image data in a standardized JPEG format and sensor data in a JSON format, encoding unique identifiers to form standardized strings; encrypting the formatted data using the SHA-256 hash algorithm to generate a fixed-length hash value; storing the encrypted data records on the blockchain and verifying the legitimacy of the new block through a proof-of-work consensus mechanism; and updating the distributed ledger of all nodes to ensure that the data cannot be tampered with. In some embodiments, the SHA-256 hash algorithm is defined as follows: SHA-256 is a cryptographically secure hash function that converts data input of any length into a fixed-length 256-bit (32-byte) hash value. Characteristics: Irreversibility: The original data cannot be derived from the hash value. Uniqueness: Different inputs almost always generate different hash values. Fixed-length: Regardless of the input length, the output is always 256 bits. Collision resistance: It is difficult to find two inputs that generate the same hash value. Data encryption process: Data preparation. Collected multi-source data includes image files (JPEG format, file name: Batch002_image.jpg). Sensor data is formatted in JSON format, using unique identifier strings. SHA-256 hash calculation is performed. A hash value is calculated for each piece of data. The generated hash value, timestamp, and hash value of the previous block are combined to form a new block. Proof of Work (PoW) consensus mechanism. Definition of Proof of Work: PoW is a blockchain consensus mechanism that requires participating nodes to solve a complex mathematical puzzle to verify the legitimacy of a new block. Solving the puzzle requires a certain amount of computing resources and time. Core concept: Nodes must find a hash value that meets specific rules. The difficulty is determined by the specific format of the target hash value (such as the number of leading zeros). The Proof of Work process involves target setting. The blockchain system sets a difficulty target. For example, the generated block hash value must begin with four zeros (e.g., 0000xxxxxx...). Random number attempts: Each node adds a random number field to the new block, repeatedly adjusting the random number and recalculating the block hash until the target condition is met. If the calculated hash value does not meet the condition, the node increases the random number and tries again, eventually finding a random number field that makes the block hash meet the target condition. Verification process: After receiving the new block, other nodes verify the following: whether the hash value in the block meets the target condition; whether the hash value of the data is consistent with the original content; and whether the blockchain maintains continuity (checking the hash value of the previous block). Consensus: When a majority of nodes pass verification, the new block is officially added to the blockchain, and all nodes synchronize and update the distributed ledger.
[0063] In some embodiments, the processed data is combined to generate a comprehensive feature vector, including: using a color histogram to extract color distribution features of the image data, a grayscale co-occurrence matrix to extract texture features, an edge detection algorithm to extract edge features, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector, and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
[0064] In some embodiments, the y' i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k ; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows:
[0065]
[0066] Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
[0067] Example 2:
[0068] This application also provides a fiber raw material traceability system based on big data, such as Figure 2As shown in the figure, the system hardware includes: a data acquisition module. The HD camera function: collects images of the appearance of fiber raw materials, such as color, curl, and gloss. The resolution should be no less than 1920x1080 and is installed at the fiber raw material collection station or production line. Sensors collect environmental parameters, including temperature and humidity, light intensity, and GPS location. A temperature and humidity sensor (such as DHT22): records the temperature and humidity of the collection environment. A light sensor (such as BH1750): monitors light intensity. A GPS module (such as NEO-6M): obtains geographic coordinates. An RFID reader reads the unique identifier (RFID tag) of each batch of fiber raw materials. The frequency range is 13.56MHz and is used for tag reading. A data processing module: The edge computing device performs preliminary processing on the collected image data, sensor data, and unique identifier. An embedded processor (such as NVIDIA Jetson Nano) or a micro industrial computer. The data formatting module compresses image data into a standardized JPEG format, encodes sensor data into JSON format, and hashes the unique identifier. The data storage and blockchain module: The blockchain node server stores a blockchain copy of the traceability information, verifies, and synchronizes blockchain data. Servers run the Hyperledger Fabric or Ethereum blockchain platforms. Distributed databases provide the ability to quickly access and analyze traceability information. Cloud databases (such as MongoDB Atlas) are used to store summaries of blockchain records and query results. User query module: Terminal devices provide users with a query portal. Consumers use smartphones to scan QR codes. Enterprise users access the traceability system's web interface through computers. Display devices visualize traceability information, such as LCD screens, mobile phone screens, and industrial terminal screens. The network communication module: The IoT gateway connects the data acquisition module with the blockchain node server to enable data upload and synchronization. The IoT communication gateway supports 4G / 5G / Wi-Fi. The cloud service interface enables data exchange between the blockchain and the distributed database. It uses HTTP API or WebSocket protocols.
[0069] System connection method, data acquisition module connection, high-definition cameras, sensors and RFID readers are connected to the edge computing device through an industrial bus (such as RS485 or CAN bus). The edge computing device is connected to the IoT gateway via Ethernet or Wi-Fi to transmit processed data in real time. Data processing module connection: The edge computing device compresses, encodes and normalizes the collected data, and then uploads it to the blockchain node server through the IoT gateway. The formatted data includes: image file: JPEG format. Sensor data: JSON encoding. Unique identity identifier: hash value. Blockchain and database connection: The blockchain node server is connected to the distributed database through the cloud service interface: The blockchain stores complete traceability data records. The database stores simplified query indexes and provides quick access functions. User query module connection: Users access the query interface through smart terminals, interact with the distributed database, and obtain traceability information. The query conditions (such as RFID number or batch number) are sent to the block data acquisition module through the API to collect multi-source data of fiber raw materials. The multi-source data includes: image data, sensor data, and unique identity identifiers;
[0070] A comprehensive vector generation module compresses image data into a standardized JPEG format, encodes sensor data into JSON format, normalizes unique identifiers to generate standardized strings, and combines the processed data to generate a comprehensive feature vector;
[0071] The fiber raw material parameter recognition module inputs the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs the fiber raw material parameters, which include the curvature of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is:
[0072]
[0073] Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, and its value range is [0,1]; K is the total number of categories; category k is the province where each fiber raw material sample is located determined by its GPS coordinates. The fiber raw material samples are divided by province, and each province corresponds to a category k.
[0074] The blockchain data storage module uses blockchain technology to encrypt and store traceability information to ensure that the data cannot be tampered with. A distributed database is established in the cloud to store all traceability information for quick access and analysis. The traceability information includes collected multi-source data and fiber raw material parameters.
[0075] In the query module, when the user queries, the fiber raw material parameters in the blockchain are retrieved and displayed through the terminal, and the information is sent to the customer terminal.
[0076] In some embodiments, the sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record the ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp and batch number; the location information, timestamp, ambient temperature and humidity during the transportation of raw materials are collected; the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
[0077] In some embodiments, the use of blockchain technology to encrypt and store the collected multi-source data includes: formatting the collected multi-source data, that is, standardizing the image data in JPEG format, storing the sensor data in JSON format, encoding the unique identity identifier to form a standardized string; encrypting the formatted data by using the SHA-256 hash algorithm to generate a hash value of a fixed length; storing the encrypted data records in the blockchain, and verifying the legitimacy of the new block through the proof-of-work consensus mechanism; updating the distributed ledgers of all nodes to ensure that the data cannot be tampered with.
[0078] In some embodiments, the processed data is combined to generate a comprehensive feature vector, including: using a color histogram to extract color distribution features of the image data, a grayscale co-occurrence matrix to extract texture features, an edge detection algorithm to extract edge features, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector, and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
[0079] In some embodiments, the y' i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows:
[0080]
[0081] Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
[0082] The present invention provides a fiber raw material traceability method and system based on big data, which can achieve the following beneficial technical effects:
[0083] 1. This invention utilizes IoT devices to collect multi-source data on raw materials, including image data, sensor data, and unique identifiers. The collected data is standardized and combined to generate a comprehensive feature vector. This comprehensive feature vector is then input into an improved convolutional neural network to output fiber raw material parameters, including curl, length, color characteristics, region, and production time. This traceability information is encrypted and stored using blockchain technology. Users can retrieve and display fiber raw material parameters in real time through a query module. By incorporating big data analysis and blockchain technology, this invention addresses the issues of data fragmentation, susceptibility to tampering, and lack of intelligence found in existing fiber raw material traceability and quality monitoring methods. This significantly improves traceability transparency, data security, and monitoring efficiency, making it suitable for supply chain management and quality control in the textile industry.
[0084] 2. The present invention collects multi-source data of fiber raw materials during production, transportation and storage through Internet of Things devices, including image data, sensor data and unique identity information, and builds a full-process traceability system covering the raw material collection site to the end user. Users can query detailed information such as the origin, production environment, and transportation route of raw materials in real time, meeting the needs of consumers and enterprises for supply chain transparency. It supports multi-source data fusion, improves the comprehensiveness of traceability and quality monitoring, generates comprehensive feature vectors through the fusion processing of image data, sensor data and unique identity information, comprehensively analyzes the multi-dimensional information that affects the quality of fiber raw materials, and constructs a multi-dimensional quality traceability model, which solves the limitations of traditional single data source monitoring methods.
[0085] 3. This invention leverages blockchain technology to ensure data authenticity and immutability. Collected multi-source data is formatted and encrypted before being stored on the blockchain. Leveraging blockchain's decentralized and distributed ledger nature, this ensures the authenticity and immutability of traceability data, effectively preventing information falsification within the supply chain and enhancing data credibility. 6. Through blockchain's distributed storage and automated intelligent analysis, this invention reduces the workload of manual recordkeeping and repeated checks, significantly improving supply chain management efficiency while also reducing enterprise management costs.
[0086] 4. This invention incorporates artificial intelligence algorithms to achieve intelligent analysis of quality parameters. By processing comprehensive feature vectors through an improved convolutional neural network and incorporating weights assigned to fiber raw material categories into training considerations, this method effectively addresses the issue of unbalanced data distribution and significantly enhances the classification model's ability to identify small sample categories. This method intelligently extracts quality parameters such as curl, length, and color characteristics of fiber raw materials, replacing traditional manual inspection methods. This significantly improves the efficiency and accuracy of quality assessments and reduces subjective errors caused by human factors.
[0087] The above is a detailed introduction to a fiber raw material traceability method and system based on big data. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the ideas and methods of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A fiber raw material traceability method based on big data, characterized in that: Including steps: S1: Collect multi-source data of fiber raw materials, including image data, sensor data, and unique identification; S2: compresses image data into a standardized JPEG format, encodes sensor data into JSON format, normalizes unique identifiers to generate standardized strings, and combines the processed data to generate a comprehensive feature vector; S3: Input the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs fiber raw material parameters, which include the curliness of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is: Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, with a value range of [0,1]; K is the total number of categories; category k is the province where each fiber raw material sample is located, determined by its GPS coordinates. Fiber raw material samples are divided by province, with each province corresponding to a category k; S4: Use blockchain technology to encrypt and store traceability information to ensure that the data cannot be tampered with; establish a distributed database in the cloud to store all traceability information for quick access and analysis: traceability information includes collected multi-source data and fiber raw material parameters; S5: When the user queries, the fiber raw material parameters in the blockchain are retrieved and displayed through the terminal, and the information is sent to the customer terminal.
2. The fiber raw material traceability method based on big data according to claim 1, characterized in that: The sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp, and batch number; the location information, timestamp, ambient temperature, and humidity during the transportation of raw materials are collected; the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
3. The fiber raw material traceability method based on big data according to claim 1, characterized in that: The method utilizes blockchain technology to encrypt and store the collected multi-source data, including: formatting the collected multi-source data, i.e., storing image data in a standardized JPEG format, storing sensor data in a JSON format, encoding the unique identity identifier to form a standardized string; encrypting the formatted data using the SHA-256 hash algorithm to generate a hash value of a fixed length; storing the encrypted data records in the blockchain, and verifying the legitimacy of the new block through a proof-of-work consensus mechanism; and updating the distributed ledgers of all nodes to ensure that the data cannot be tampered with.
4. The fiber raw material traceability method based on big data according to claim 1, characterized in that: The method combines the processed data to generate a comprehensive feature vector, including: extracting color distribution features from the image data using a color histogram, extracting texture features using a grayscale co-occurrence matrix, extracting edge features using an edge detection algorithm, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector, and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
5. The fiber raw material traceability method based on big data according to claim 1, characterized in that: The y′ i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k ; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows: Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
6. A fiber raw material traceability system based on big data, characterized in that: include: Data acquisition module, collects multi-source data of fiber raw materials, including image data, sensor data, and unique identification; A comprehensive vector generation module compresses image data into a standardized JPEG format, encodes sensor data into JSON format, normalizes unique identifiers to generate standardized strings, and combines the processed data to generate a comprehensive feature vector; The fiber raw material parameter recognition module inputs the comprehensive feature vector into the trained improved convolutional neural network, and the convolutional neural network outputs the fiber raw material parameters, which include the curvature of the fiber raw material, the length of the fiber, the color characteristics of the fiber raw material, the region, and the generation time. The loss function L used in the training of the improved convolutional neural network is: Where L is the total loss value, N is the total number of fiber raw material samples; α k is the weight of category k, y i,k is the true label of sample i belonging to category k, which takes the value of 1 or 0; y' i,k is the predicted probability that sample i belongs to category k, with a value range of [0,1]; K is the total number of categories; category k is the province where each fiber raw material sample is located, determined by its GPS coordinates. Fiber raw material samples are divided by province, with each province corresponding to a category k; The blockchain data storage module uses blockchain technology to encrypt and store traceability information to ensure that the data cannot be tampered with. A distributed database is established in the cloud to store all traceability information for quick access and analysis. The traceability information includes collected multi-source data and fiber raw material parameters. In the query module, when the user queries, the fiber raw material parameters in the blockchain are retrieved and displayed through the terminal, and the information is sent to the customer terminal.
7. The fiber raw material traceability system based on big data according to claim 6, characterized in that: The sensor data is obtained by installing sensors at the raw material collection site using IoT devices to record ambient temperature, humidity, and light intensity data in real time; the unique identity identifier is assigned to each batch of raw materials through radio frequency identification RFID or QR code, including the GPS coordinates of the source, timestamp, and batch number; the location information, timestamp, ambient temperature, and humidity during the transportation of raw materials are collected; the image data is obtained by recording the appearance of the raw materials through a high-definition camera to generate image data corresponding to the raw material batch.
8. The fiber raw material traceability system based on big data according to claim 6, characterized in that: The method utilizes blockchain technology to encrypt and store the collected multi-source data, including: formatting the collected multi-source data, i.e., storing image data in a standardized JPEG format, storing sensor data in a JSON format, encoding the unique identity identifier to form a standardized string; encrypting the formatted data using the SHA-256 hash algorithm to generate a hash value of a fixed length; storing the encrypted data records in the blockchain, and verifying the legitimacy of the new block through a proof-of-work consensus mechanism; and updating the distributed ledgers of all nodes to ensure that the data cannot be tampered with.
9. The fiber raw material traceability system based on big data according to claim 6, characterized in that: The method combines the processed data to generate a comprehensive feature vector, including: extracting color distribution features from the image data using a color histogram, extracting texture features using a grayscale co-occurrence matrix, extracting edge features using an edge detection algorithm, and merging the extracted feature vectors into an image feature vector; normalizing and standardizing the sensor data to form a sensor feature vector of a fixed length; hash encoding the unique identity identifier and converting the encoding result into a numerical feature vector of a fixed length; and combining the image feature vector, the sensor feature vector, and the unique identity identifier feature vector into a comprehensive feature vector through a splicing operation.
10. The fiber raw material traceability system based on big data according to claim 6, characterized in that: The y' i,k The predicted probability that sample i belongs to category k includes: inputting the comprehensive feature vector into the trained convolutional neural network; extracting features from the comprehensive feature vector through the convolution layer and pooling layer in turn, and flattening it to form a one-dimensional feature vector; inputting the flattened one-dimensional feature vector into the fully connected layer, and calculating the unnormalized score z for each category k i,k ; Use the Softmax function to convert the unnormalized score into a predicted probability. The calculation formula is as follows: Among them, j is a variable with a value range of [1, K]; z i,j is the unnormalized score of sample i belonging to category k.
Citation Information
Patent Citations
Block chain-based sesame raw material quality inspection management method and system
CN117078115A
Textile traceability system and method based on block chain
CN117709979A