Complex fusion network training system and method based on block chain
By introducing blockchain technology into the complex fusion network training system, combined with smart contracts and chain codes, it solves the data privacy and security issues in cross-camera data fusion scenarios, achieves efficient and safe processing and storage of data, and improves the system robustness and perception capabilities.
Patent Information
- Application Number
- CN202411050950.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-01
AI Technical Summary
Existing complex fusion network training technology is difficult to ensure data privacy and security, cross-domain differences and synchronization in cross-camera or multi-source data fusion scenarios, and it is difficult to defend against external attacks on distributed systems, limiting its usability and effectiveness in practical applications. Practicality.
Adopt a complex fusion network training system based on blockchain, through the target visual computing network and target feature chain, combined with smart contracts and chain codes, to achieve encrypted storage and non-tamperability of data, and through the decentralized structure of the blockchain and The Hashgraph consensus algorithm ensures data security and synchronization.
It improves the robustness of the system and the secure fusion capabilities of multi-source data, enhances the ability to perceive complex scenarios, improves the usability and practicality of the system, ensures the privacy and non-tamperability of data, and protects against external threats to the distributed system. attack.
Smart Images

Figure CN118865254A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a complex fusion network training system and method based on blockchain, belonging to the technical field of computer vision. Background Art
[0002] The massive video data generated by cameras has brought immeasurable value to the development of modern smart cities, and various visual perception tasks have always been an important research direction in this field. As the development of modern smart cities relies more and more on video data, how to extract homogeneous semantics from video data and use complex fusion network training technology to achieve parallel processing of multiple tasks has become a hot topic in the field of smart cities. Although different visual perception tasks need to pay attention to different scene semantic information, these semantics are fundamentally dependent on specific structure and part semantics. In view of this, researchers have proposed complex fusion network training technology, which aims to achieve efficient sharing and reuse of knowledge by building a shared neural network that can handle multiple visual perception tasks simultaneously. The notable feature of this type of technology is its powerful multi-task processing capability, which can integrate multiple visual perception tasks into a single model. However, the existing complex fusion network training technology focuses on improving the overall performance in centralized scenarios, but often ignores the problems of data privacy and security, cross-domain differences and synchronization, and external attack and defense of distributed systems in cross-camera or multi-source data fusion scenarios in actual applications. Due to availability and practicality, it is difficult to actually apply it to real environments. In the cross-camera or multi-source data fusion scenarios of modern smart cities, how to ensure data privacy and security, solve cross-domain differences and synchronization issues, and defend against external attacks on distributed systems have become technical challenges that need to be solved urgently. Summary of the invention
[0003] The technology of the present invention solves the problem of data privacy and security, cross-domain differences and synchronization, and external attack and defense of distributed systems in existing complex fusion network training technologies in cross-camera or multi-source data fusion scenarios, and provides a complex fusion network training system and method based on blockchain, which can process the recognition of multiple tasks of pedestrians and vehicles in parallel. At the same time, the introduction of blockchain technology effectively ensures the security and non-tamperability of the data, greatly improves the availability and practicality of the system, and achieves the effect of enhancing the robustness of the system, promoting the secure fusion of multi-source data, and improving the perception ability of complex scenes.
[0004] Technical solution of the present invention: In the first aspect, the present invention provides a complex fusion network training system based on blockchain, including a target visual computing network and a target feature chain; the target visual computing network performs parallel pre-training on the target frames in the collected target monitoring video based on public data sets and adaptive loss functions for different task types in multiple tasks, calculates the target feature information related to the current specific task type, and stores the target feature information in the target feature chain through smart contracts and chain codes; the target feature chain stores encrypted target feature information to ensure the security and privacy of the target feature information; the target feature chain decrypts the encrypted target historical feature information through smart contracts and chain codes and sends it to the target visual computing network; the multiple tasks are determined by the user according to user needs; and it supports the independent execution of the multiple tasks for two target types, pedestrians and vehicles.
[0005] Furthermore, the different task types among the multiple tasks are target pose estimation, target semantic segmentation, target detection, target re-identification and target attribute recognition.
[0006] Further, the target visual computing network includes: a monitoring video acquisition module, a feature encoding module, a task control module, and a feature decoding module: the target feature chain includes a blockchain trusted storage module and a blockchain interaction module; The monitoring video acquisition module is used to collect target monitoring videos, and extract target frames from the target monitoring videos and input them into the feature encoding module; the module is composed of multiple cameras that do not contain overlapping areas, and each camera exists as a node alone; The feature encoding module: includes multiple Transformer encoders, preprocesses the extracted target frames, and supports synchronous preprocessing of target frames of different sizes. When these target frames are preprocessed, they are downsampled according to the size of the target frames, and a group of scaled target frames of fixed size are obtained after preprocessing; a position embedding with consistent dimension is learned based on the scaled target frames, and the position embedding is interpolated and input together with the scaled target frame group into multiple Transformer encoders for layer-by-layer optimization to obtain encoded global feature information, and the encoded global feature information is input into the feature decoding module; The task control module is responsible for the quantization of tasks and obtains the embedding corresponding to the tasks and their position embedding. The user inputs one or more tasks through this module. The adaptive target quantization method is used to adaptively quantize the specific task types, target types, and queries in the various tasks, and each task is quantized into the corresponding embedding and its position embedding, which are input into the feature decoding module. The various tasks share the feature encoding module and the feature decoding module, and the quantization process of each task is independent of each other and does not interfere with each other. The feature decoding module can be used to simultaneously determine the feature information related to the current task in the global feature information, so as to realize the parallel quantization of the various tasks and synchronously input them into the feature decoding module. The feature decoding module includes multiple Transformer decoders, which decode the global feature information generated by the feature encoding module into target feature information related to the current specific task according to the specific tasks quantified in the task control module, and further specify an output unit for the obtained target feature information to obtain output information, wherein the output information includes a feature vector, a global probability map, a local probability map and a calibration frame; the output information is stored in the blockchain trusted storage module through the blockchain interaction module using smart contracts and chain codes as the medium; at the same time, the blockchain interaction module determines whether the same target history information is stored in the blockchain trusted storage module, wherein the target history information also includes a feature vector, a global probability map, a local probability map and a calibration frame; if so, the current output information and the target history information are returned to the user together, and if not, only the current output information is returned to the user.
[0007] The blockchain trusted storage module includes multiple nodes, which form a blockchain. All nodes have a consistent blockchain ledger locally, which is used to store the encrypted information output by the blockchain interaction module. The encrypted information has the structural characteristics of blockchain decentralization, trustworthiness, and traceability, ensuring that the encrypted information cannot be tampered with. The blockchain interaction module: initiates blockchain transactions based on smart contracts and chain codes to achieve intercommunication between the target visual computing network and the blockchain in the blockchain trusted storage module; encrypts the output information stored in the blockchain by the feature decoding module through the chain-driven encryption algorithm and packages it into a blockchain transaction, and sends it to the blockchain trusted storage module; it is also responsible for decrypting the encrypted information already stored in the blockchain in the blockchain trusted storage module through the chain-driven encryption algorithm and packaging it into a blockchain transaction, and returning it to the feature decoding module.
[0008] Furthermore, the adaptive loss function is obtained by combining several sub-loss functions with a group of control circuit gates; the several sub-loss functions include a decoding loss function, a segmentation loss function, a regression loss function, a detection loss function and a classification loss function; one or a combination of the above-mentioned various loss functions is obtained by controlling a group of control gates according to the task type; The decoding loss function is used to supervise the output information in the feature target visual computing network and correct the difference between the input and the decoding output of the global feature information according to the task type and the target type; The segmentation loss function is used to measure the overlap between the predicted segmentation area and the actual segmentation in the two tasks of target semantic segmentation and target detection; The regression loss function is used to calculate the error between the predicted value and the true value in the two tasks of target posture estimation and target detection; The detection loss function is a loss function used to deal with the category imbalance problem in the target detection task, emphasizing the training for the detected difficult-to-classify targets; The classification loss function is used to correct the error between the predicted calibration frame corresponding to the global feature information and the real calibration frame (the predicted calibration frame is the calibration frame output by the feature decoding module) in the three tasks of target re-identification, target attribute recognition, and target semantic segmentation; The metric loss function is used to correct the distance between the detection sample and the positive and negative samples in the feature space in the target re-identification task; the positive samples are close to each other, and the negative samples are far away from each other; the samples are target pedestrians or target vehicles, the positive samples are the same target, and the negative samples are different targets; The control gate configures one or a combination of corresponding loss functions in a plurality of tasks for the target visual computing network according to the task type and the target type, thereby realizing an adaptive loss function.
[0009] Furthermore, in the task control module, the query method is as follows: the target posture estimation task is a task specific to pedestrian targets, the target semantic segmentation task is responsible for segmenting the human body structure for pedestrian targets, and is responsible for separating each vehicle instance from the background for vehicle targets, and the target attribute recognition task is responsible for identifying the characteristic attributes of pedestrians for pedestrian targets, and is responsible for identifying the specific attributes of vehicles for vehicle targets; The query is determined by the task type and the target type. For pedestrian targets, the query for target pose estimation is the pose joint points, and the query number is the number of pose joint points; the query for target semantic segmentation is the pedestrian semantic segmentation category, and the query number is the number of semantic segmentation categories; the query for target detection is the size of the detected target at different anchor points, and the query number is the number of anchor points; the query for target re-identification corresponds to the dimension of the re-identification feature; the query for target attribute recognition is the type of pedestrian attribute, and the query number is the number of pedestrian attributes; for vehicle targets, the quantitative definition of target detection and target re-identification tasks is pedestrian targets; there is no target pose estimation task for vehicle targets; the query for target semantic segmentation is the vehicle semantic segmentation category, and the query number is the number of semantic segmentation categories; the query for target attribute recognition is the vehicle attribute type, and the query number is the number of vehicle attributes.
[0010] Furthermore, in the task control module, the adaptive quantization method is implemented as follows: (1) First, initialize all tasks entered by the user into a set of task-related queries ,in is the number of queries related to the corresponding task, Represents the content of each specific query; (2) Then, the query set corresponding to all tasks entered by the user is Randomly initialized to a learnable embedding , optimized layer by layer in all Transformer encoders in the feature decoding module; (3) Finally, for each query vector set Binding a learnable position embedding , where for the four tasks of target pose estimation, target semantic segmentation, target re-identification, and target attribute recognition, the corresponding For the target detection task, the corresponding Initialized as a map of anchors uniformly distributed in the target frame; learnable position embeddings Shared among all Transformer decoders in a feature decoding module.
[0011] Furthermore, in the feature decoding module, the output information includes a feature vector, a global probability map, a local probability map and a calibration frame; corresponding to the output information, the feature decoding module output unit includes four types, namely, a feature vector output unit, a global probability map output unit, a local probability map output unit and a calibration frame output unit; wherein all tasks activate the feature vector output unit; in addition, the target semantic segmentation task and the target posture estimation task also need to activate the local probability map output unit and the global probability map output unit, the target detection task also needs to activate the global probability map output unit and the calibration frame output unit, and the target attribute recognition also needs to activate the global probability map output unit; the feature vector, global probability map, local probability map and calibration frame information output by the above output units are all stored in the blockchain interaction module via the blockchain interaction module with smart contracts and chain codes as the medium.
[0012] Furthermore, in the blockchain trusted storage module, the nodes are all trusted nodes by default, that is, nodes participating in blockchain interactions. If a node repeatedly inserts fabricated information, the node is updated to an untrusted node according to a reputation-based blockchain node election mechanism; the reputation-based blockchain node election mechanism regularly selects the node with the highest reputation as the leader node, and prevents nodes with low reputation below a set threshold from participating in blockchain interactions, thereby preventing untrusted nodes from storing fabricated information; The implementation method of the reputation-based blockchain node election mechanism is as follows: (1) Create a pair of public and private keys for each node in the blockchain interaction module using the national secret SM2 elliptic curve algorithm, generate a digital signature based on the public key, and broadcast it to other nodes in the blockchain; (2) When deploying the blockchain in the blockchain interaction model, the public keys, digital signatures, and initial reputation values of all nodes are stored in the genesis block. When a new node joins the blockchain, its public key and digital signature need to be packaged into the transaction through the smart contract and chain code and stored in the blockchain; (3) Execute the leader node election algorithm. The node that wants to be elected as the leader node obtains a random number and a reputation certificate through the VRF verifiable random function. If the reputation value of the node is non-negative, the node is considered eligible to run for the leader node and is added to the leader node candidate list. Finally, the node's digital signature, public key, random number generated by VRF, reputation certificate and other information are broadcast to other nodes. The VRF is a special algorithm that can determine low-reputation nodes and verify random functions. (4) When a node receives information such as digital signatures, public keys, random numbers generated by VRF, and reputation certificates from other nodes, it verifies whether the received random numbers and reputation certificates are credible based on the VRF verifiable random function. If they are credible, the node is recognized to be included in the candidate list of leader nodes. If they are not credible, the node’s reputation value is reduced. (5) Finally, the node with the highest random value in the leader node candidate list is selected as the leader node.
[0013] The above process ensures that low-reputation nodes cannot become leader nodes, and the leader node election process is unpredictable and fair enough.
[0014] Furthermore, the blockchain trusted storage module also adopts a hash graph-based blockchain consensus algorithm to ensure the data consistency of the blockchain ledgers locally existing in each node; The process of the blockchain consensus algorithm based on hash graph is as follows: (1) Create an empty hash graph copy locally on all nodes. The root node on the vertical axis of the hash graph represents each node in the blockchain, and the other nodes on the vertical axis represent the blocks generated on their corresponding root nodes. The block data structure contains two hash pointers pointing to the parent block. (2) Each node maintains a copy of the hash graph of each blockchain node through the Gossip protocol; each node attempts to randomly find other nodes and synchronize the local copy of the hash graph through the Gossip protocol; (3) The node that receives the Gossip request creates a new block in the local hash graph copy and points the two parent hash pointers in the block to its own last block and the last block of the Gossip source node; (4) Create rounds for all blocks in the hash graph replica and determine whether the block is a witness block in that round; (5) Conduct virtual voting on all known witness blocks to elect well-known witness blocks; (6) Determine the consensus order of all blocks through well-known witness blocks and complete the consensus process; The witness block refers to the first block created on each node in round R of the hash graph replica; The well-known witness block refers to a block whose witness block in round R of the hash graph replica is strongly visible to more than two-thirds of the witness blocks in round R+1; The block strong visibility mentioned above means that the set of all paths from block A to block B in the hash graph copy covers more than two-thirds of the number of nodes; The round allocation creation refers to the rounds are divided into creation rounds and acceptance rounds. The creation round is the round in which a block is created, and generally belongs to the same round as its parent block; the acceptance round means that when a block can see more than two-thirds of the witness blocks of this round, the block will be promoted by one round; The virtual voting refers to the election process of well-known witnesses. The witness blocks of round r+1 vote on the witness blocks of round r. According to the definition of rounds, the witness blocks of round r+2 can see most of the witness blocks of round r+1. Therefore, the witness blocks of round r+2 count the votes of the witness blocks of round r+1, thus determining the final voting result. The above blocks all refer to blocks in the blockchain.
[0015] Furthermore, in the blockchain trusted storage module, the blockchain transaction types are the following four: The first is information storage transaction, which is responsible for executing the chain-driven encryption algorithm to encrypt the global feature information output by the feature encoding module and the specific information generated by each output unit in the feature decoding module, and store the encrypted information in the blockchain trusted storage module to ensure the privacy of the output information of the target visual computing network; The second type is the query transaction, which is responsible for initiating queries to other nodes in the blockchain to verify whether the target corresponding to the currently stored encrypted information has encrypted information already stored in the blockchain, so as to achieve maximum effective knowledge sharing; The third type is to confirm the transaction, which is responsible for responding to the encrypted information of the initiating node of the query transaction to see whether the target corresponding to the encrypted information has been stored in the blockchain in the past. If so, the initiating node of the query transaction will be responded to, otherwise, no response will be given; The fourth type is the information transmission transaction, which is responsible for extracting the encrypted information previously stored in the blockchain by the target, decrypting it using the chain-driven encryption algorithm, and sending it to the initiating node of the query transaction.
[0016] Furthermore, in the blockchain interaction module, the encryption algorithm adopts a chain-driven encryption algorithm; The chain-driven encryption algorithm includes a group encryption mechanism, a group decryption mechanism, a trusted transmission mechanism, and a distributed defense mechanism; the group encryption mechanism and the group decryption mechanism cooperate with each other to realize the encryption and decryption of information, and are packaged into blockchain transactions between nodes and blockchain interaction modules through a trusted transmission mechanism for transmission, and rely on a distributed defense mechanism to overcome the replay attack problem existing in blockchain technology; the encrypted information stored in the blockchain is encrypted using a group encryption mechanism when it is stored, and a group decryption mechanism is used to restore the ciphertext when it is retrieved; the trusted transmission mechanism is a mechanism that ensures that the process of transmitting information to the blockchain will not be attacked when the node initiates an access command to the blockchain; the distributed defense mechanism can solve the problem of replay attacks; the trusted transmission mechanism, the distributed defense mechanism, and the encryption and decryption mechanism jointly ensure the overall security of the blockchain contained in the target feature chain; In the block cipher encryption mechanism, the node sends the information to be encrypted to the blockchain interaction module using smart contracts and chain codes as the medium. After receiving the information, the smart contract and chain code obtain the key according to the node identity, and execute the SM4 block symmetric encryption algorithm on the information to be encrypted, and store the encrypted information in the blockchain trusted storage module; In the group decryption mechanism, the node sends a request transaction to the blockchain transaction module through the smart contract and chain code to obtain the encrypted information. After receiving the encrypted information, the smart contract and chain code obtain the key according to the node identity, and decrypt the encrypted information based on the SM4 group symmetric encryption algorithm, and return the decrypted information to the node; In the trusted transmission mechanism, the TLS protocol is deployed for all nodes, and the corresponding TLS encryption certificates are generated for all nodes through the national secret SM2 elliptic curve algorithm to defend against active attacks during the transmission process; In the distributed defense mechanism, a random number Nonce (block header transaction random number) is deployed in the blockchain transaction payload of each blockchain transaction. The blockchain processes transactions according to the positive order of Nonce values. When a transaction with an incorrect Nonce value order is found, the transaction is placed in the pending transaction memory pool, waiting for the arrival of the correct transaction, thereby overcoming the replay attack of the distributed system.
[0017] In a second aspect, the present invention also provides a complex fusion network training method based on blockchain, which is implemented as follows: (1) Extract target frames from target surveillance video; (2) Preprocess the target frame and learn a position embedding with consistent dimensions, optimize it layer by layer in the Transformer encoder, obtain the encoded global feature information, and input it into the decoder; (3) The user inputs the task type and selects the target type. The embedding layer quantizes the task into the corresponding embedding and its position embedding according to the adaptive quantization method and inputs it into the decoder. (4) Based on the quantized task, the global feature information of the target is decoded into target feature information related to the specific task based on the Transformer decoder; (5) According to the quantized task, the output unit is specified for the obtained target feature information to obtain the task-related feature information, which is sent to the target feature chain for storage and synchronously returned to the user; (6) The target feature chain processes the feature information output by the feature decoding module based on the smart contract and chain code. First, the feature information is encrypted according to the block encryption mechanism of the chain-driven encryption method. Then, the encrypted information is packaged into information storage transactions for transmission according to the trusted transmission mechanism of the chain-driven encryption algorithm. The distributed defense mechanism of the chain-driven encryption algorithm is used to overcome the replay attack problem existing in blockchain technology. (7) After receiving the information storage transaction, the transaction is sorted by consensus based on a hash graph-based blockchain consensus algorithm, and a leader node is selected based on a reputation-based blockchain node election mechanism. The transaction is packaged into blocks and stored in the blockchain to complete the information storage transaction process; (8) If the user specifies that the historical feature information of the target that has been stored in the blockchain needs to be obtained, a Boolean mark is sent to the decoder. When the Boolean mark is true, the decoder sends the output feature vector separately to the target feature chain; (9) The target feature chain processes the feature vector output by the feature decoding module based on the smart contract and chain code, packages the feature vector into a query transaction based on the trusted transmission mechanism of the chain-driven encryption algorithm, and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism; (10) The node in the blockchain that wants to respond to the query transaction obtains the corresponding feature vector from the block corresponding to the query transaction, calculates the cosine similarity between the feature vector and its own feature vector previously stored in the blockchain based on the smart contract and chain code, and determines whether the target corresponding to the encrypted information previously stored has encrypted information already stored in the blockchain; if not, it does not respond to the query transaction initiating node; if so, it initiates a confirmation transaction to the query node and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism; (11) After the transaction is confirmed to be completed, the node in the blockchain that needs to respond to the query transaction extracts the encrypted information that has been stored in the blockchain from the target feature chain through the blockchain interaction module, and decrypts the encrypted information based on the smart contract and chain-driven encryption algorithm, packages it into an information transmission transaction, and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism, returning the decrypted information to the decoder in the target visual computing network, and finally returning it to the user.
[0018] In a third aspect, the present invention further provides an electronic device, comprising a processor and a memory, wherein: Memory, used to store computer programs; The processor is used to execute the computer program stored in the memory, and implement the aforementioned method or the aforementioned system when executed.
[0019] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the aforementioned method or the aforementioned system is implemented.
[0020] The advantages of the present invention compared with the prior art are: (1) The present invention can process multiple types of tasks for pedestrians and vehicles in parallel, including target pose estimation, target semantic segmentation, target detection, target re-identification and target attribute recognition. At the same time, the introduction of blockchain technology effectively ensures the security and immutability of data, greatly improves the availability and practicality of the system, and achieves the effect of enhancing the robustness of the system, promoting the secure fusion of multi-source data and improving the perception ability of complex scenes.
[0021] (2) The embodiment of the present invention realizes efficient and secure processing and storage of target features in surveillance videos by combining the target visual computing network with the target feature chain. First, in the target visual computing network, parallel training is performed for multiple task types to improve training efficiency. Second, the target feature chain, as a secure storage medium, encrypts and protects the security and privacy of target feature information. In addition, the system supports multiple task types and two target types, which can be determined according to user needs, thereby improving training flexibility. Finally, through the application of smart contracts and chain codes, the storage and interaction of target feature information are realized, and the decentralized structure of the blockchain ensures the immutability and credibility of the information. Compared with the existing technology, it can efficiently perform multi-task training, protect the security of target feature information, provide flexibility and credibility, and improve usability while ensuring training results.
[0022] (3) The embodiment of the present invention ensures the decentralized interaction and non-tamperability of all feature data based on blockchain technology.
[0023] (4) The embodiment of the present invention designs a reputation-based blockchain node election mechanism to prevent untrusted nodes from uploading forged data, while ensuring that trusted nodes have an equal probability of being elected as leader nodes to ensure fairness.
[0024] (5) The embodiment of the present invention designs a chain-driven encryption algorithm that can prevent data leakage and provide effective protection for the security of the data transmission process and distributed system.
[0025] (6) The embodiment of the present invention designs a blockchain consensus algorithm based on hash graph, which greatly reduces the consumption of network resources by the blockchain consensus algorithm and improves the blockchain throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A structural block diagram of a complex fusion network training system based on blockchain provided by an embodiment of the present invention; Figure 2 Schematic diagram of an adaptive loss function control gate in an embodiment of the present invention; Figure 3 A schematic diagram of task input of a task control module in an embodiment of the present invention; Figure 4 This is a schematic diagram of inputting a feature decoding module in an embodiment of the present invention; Figure 5 This is a schematic diagram of the chain-driven encryption algorithm flow in an embodiment of the present invention; Figure 6 This is the implementation process of the reputation-based blockchain node election mechanism in an embodiment of the present invention; Figure 7 A schematic diagram of a blockchain consensus algorithm based on a hash graph in an embodiment of the present invention; Figure 8 A hash graph structure in an embodiment of the present invention; Fig. 9 is a feature encoder structure in an embodiment of the present invention; Fig.10 is a feature decoder structure in an embodiment of the present invention; Fig.11 is a flow chart for implementing the method in the embodiment of the present invention; Fig.12 Schematic diagram of feature interpretation of feature decoding module in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0029] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0030] Existing complex fusion network training technologies focus on improving overall performance in centralized scenarios, but often ignore issues such as data privacy and security, cross-domain differences and synchronization, and external attacks and defenses of distributed systems in cross-camera or multi-source data fusion scenarios in actual applications. The complex fusion network training system and method based on blockchain proposed in the embodiments of the present invention extracts cross-task homogeneous features in video data through adaptive quantization methods and Transformer attention structures, and realizes parallel processing of multi-dimensional visual tasks of pedestrians and vehicles; by introducing blockchain technology, each camera is deployed as a blockchain node, and the security and non-tamperability of cross-camera data transmission are ensured based on the decentralized and traceable characteristics of blockchain, solving the data security and synchronization problems of the prior art; a reputation-based blockchain node election is proposed, which innovatively combines the national secret SM2 elliptic curve algorithm with the VRF verifiable random function, and gives nodes in the blockchain network a dynamically assessable reputation value, effectively curbing the insertion of untrusted nodes. Forged information, and the introduction of random number structure to ensure that trusted nodes can be equally elected as leader nodes, ensuring the fairness of the system; a chain-driven encryption algorithm is proposed, based on the national secret SM4 group symmetric encryption algorithm to achieve full life cycle encryption management of feature data on the chain, based on the national secret SM2 elliptic curve algorithm to generate private keys, public keys, digital signatures, TLS encryption certificates for all nodes to defend active attacks during data transmission and confirm data rights, and deploy block header transaction random numbers Nonce in the blockchain transaction payload to defend against replay attacks on distributed systems; a blockchain consensus algorithm based on hash graph is proposed, based on the Gossip protocol to achieve inter-node communication, greatly reducing the consumption of network bandwidth, and improving system performance and consensus stability. Through the above technology, the parallel processing of five tasks of target posture estimation, target semantic segmentation, target detection, target re-identification and target attribute recognition of pedestrians and vehicles is realized, and the blockchain technology is introduced to manage and protect the generated feature data throughout the life cycle. On the premise of ensuring the overall effectiveness and efficiency of the system, the availability and practicality of the system are greatly improved, achieving the effect of enhancing the robustness of the system, promoting the secure fusion of multi-source data and improving the perception ability of complex scenes.
[0031] like Figure 1 As shown, an embodiment of the present invention provides a complex fusion network training system based on blockchain, including a target visual computing network and a target feature chain; the target visual computing network performs pre-training on target frames in the collected target monitoring video based on a public data set and an adaptive loss function for different task types, and calculates target feature information related to the current specific task type, and encrypts the target feature information through a smart contract or chain code and stores it in the target feature chain; the target feature chain is used to store the encrypted target feature information to ensure the security and privacy of the target feature information; In particular, five task types are given in the embodiment of the present invention, namely, the task types are target posture estimation, target semantic segmentation, target detection, target re-identification, and target attribute recognition; at the same time, it supports independent execution of the above five tasks for two target types, pedestrians and vehicles; at that time, users can expand the tasks according to their own needs.
[0032] like Figure 1 As shown, in particular, the target visual computing network in the embodiment of the present invention includes: a monitoring video acquisition module, a feature encoding module, a task control module, and a feature decoding module: the target feature chain includes a blockchain trusted storage module and a blockchain interaction module; the monitoring video module extracts the target frame and inputs it into the feature encoding module, the feature encoding module preprocesses the target frame and encodes the global feature information to input it into the feature decoding module, the user inputs the task through the task control module, the task control module inputs the quantized task into the feature decoding module, the feature decoding module decodes the global feature information into the target feature information according to the quantized task and specifies the output unit for it to obtain the feature vector, the global probability map, and the local The probability map and calibration frame are returned to the user and sent to the blockchain interaction module in the target feature chain based on the smart contract and chain code. The blockchain interaction module packages the above information into blockchain transactions and sends them to the blockchain trusted storage module. If the user requests the target frame corresponding to the target information that has been stored in the blockchain (hereinafter collectively referred to as historical information), the feature decoding module sends the feature vector to the blockchain interaction module in the target feature chain based on the smart contract and chain code. After calculation, the blockchain interaction module packages the transaction and sends it to the blockchain trusted storage module. The blockchain trusted storage module returns the historical information to the blockchain interaction module, and further returns it to the feature decoding module. The feature decoding module returns the historical information to the user.
[0033] The following diagrams illustrate the specific contents of each module.
[0034] 1. Surveillance video acquisition module The target surveillance video is collected, and the target frame is extracted from the target surveillance video and input into the feature encoding module; the module is composed of multiple cameras that do not contain overlapping areas, and each camera exists as a node alone.
[0035] 2. Feature encoding module It includes multiple Transformer encoders, which preprocess the extracted target frames to obtain a group of scaled target frames of fixed size; this module also supports synchronous preprocessing of target frames of different sizes. When these target frames are preprocessed, they are downsampled according to the size of the target frames to obtain a group of scaled target frames of fixed size; based on the scaled target frames, a position embedding with consistent dimension is learned, and the position embedding is interpolated and input into the Transformer encoder together with the scaled target frame group to optimize layer by layer to obtain the encoded global feature information, and the encoded global feature information is input into the feature decoding module.
[0036] like Fig. 9 As shown in the figure, the target frame is downsampled 16 times to obtain a set of image patches, which are linearly transformed by the embedding layer to obtain the corresponding patch embedding, and a corresponding position embedding is learned and input into the Transformer encoder together; in the encoder, the embedding is first normalized; the normalized data is input into the multi-head attention layer, and the weighted output is obtained after linear transformation and attention weight calculation; the output of the multi-head attention layer is normalized again and input into the multi-layer perceptron; the multi-layer perceptron performs nonlinear transformation through multiple layers of fully connected layers and outputs the processed feature vector; if there is still an encoder in the future, the output of the multi-layer perceptron will be further passed to the next encoder; finally, the encoded global feature information is obtained , mathematically there is ,in Refers to The output of the encoder, Refers to patch embedding, Refers to the corresponding position embedding.
[0037] 3. Mission Control Module Responsible for the quantization of tasks, and obtaining the embedding corresponding to the task and its position embedding; the user inputs one of the five tasks through this module; an adaptive target quantization method is used to adaptively quantize each task into the corresponding embedding and its position embedding according to the specific task type, target type, and query in the task, and each task is quantized into the corresponding embedding and its position embedding, which are input into the feature decoding module; the five tasks share the feature encoding module and feature decoding module in the target visual computing network, and the quantization process of each task is independent of each other and does not interfere with each other. Therefore, the feature decoding module can be used at the same time to determine the feature information related to the current task in the global feature information, so as to realize the parallel quantization of the five tasks and synchronously input them into the feature decoding module.
[0038] like Figure 3As shown, in the task control module, the query method is: the target posture estimation task is a unique task for pedestrian targets, the target semantic segmentation task is responsible for segmenting the human body structure for pedestrian targets, and is responsible for separating each vehicle instance from the background for vehicle targets. The target attribute recognition task is responsible for identifying the characteristic attributes of pedestrians, such as "wearing a hat", and is responsible for identifying specific attributes of vehicles, such as "license plate number", etc. for vehicle targets.
[0039] The number of queries included in different task types is determined according to the specific task type. The number of queries for target pose estimation, target semantic segmentation, target re-identification and target attribute recognition are pedestrian target pose joints, target semantic segmentation categories, target re-identification feature dimensions and target attributes respectively; the number of queries for target detection is the size of the detected target that appears at different anchor point positions in the training target frame.
[0040] The query is determined by the task type and the target type. For pedestrian targets, the query for target pose estimation is the pose joints such as "left shoulder, left knee, torso, head", etc., and the query number is the number of pose joints; the query for target semantic segmentation is the pedestrian semantic segmentation categories such as "hair, top, pants", etc., and the query number is the number of semantic segmentation categories; the query for target detection is the size of the detected target at different anchor points, and the query number is the number of anchor points; the query for target re-identification corresponds to the dimension of the re-identification feature; the query for target attribute recognition is the pedestrian attribute types such as "male, elderly", etc., and the query number is the number of pedestrian attributes; for vehicle targets, the quantitative definition of target detection and target re-identification tasks is pedestrian targets; there is no target pose estimation task for vehicle targets; the query for target semantic segmentation is the vehicle semantic segmentation categories such as "window, door", and the query number is the number of semantic segmentation categories; the query for target attribute recognition is the vehicle attribute types such as "license plate number, color", etc., and the query number is the number of vehicle attributes.
[0041] It should be noted that the query method in the task control module of the embodiment of the present invention accurately specifies the query content and quantity according to the task type and target type, ensuring the pertinence and accuracy of task execution. Compared with the prior art, this method improves the system's processing capability for complex tasks, enabling target posture estimation, target semantic segmentation, target detection, target re-identification, and target attribute recognition tasks to be processed in parallel more efficiently, further improving the flexibility and practicality of the system.
[0042] like Figure 4 As shown, in the task control module, the adaptive quantization method is implemented as follows: (1) First, initialize all tasks entered by the user into a set of task-related queries ,in is the number of queries related to the corresponding task, Represents the content of each specific query, ,in Refers to target re-identification, Refers to target attribute recognition, Refers to target pose estimation, Refers to target semantic segmentation, Refers to target detection.
[0043] (2) Then, the query set corresponding to all tasks entered by the user is Randomly initialized to a learnable embedding , optimized layer by layer in all Transformer encoders in the feature decoding module.
[0044] (3) Finally, for each query vector set Binding a learnable position embedding , where for the four tasks of target pose estimation, target semantic segmentation, target re-identification, and target attribute recognition, the corresponding For target detection tasks, the corresponding Initialized as a mapping of anchor points that follows a uniform distribution in the target frame, i.e. , refer to uniformly distributed anchor points; learnable position embedding Shared among all Transformer decoders in a feature decoding module.
[0045] It should be noted that the adaptive quantization method in the task control module of the embodiment of the present invention achieves accurate capture and dynamic adjustment of the query content by initializing the task-related query set as a learnable embedding and optimizing it layer by layer in the Transformer encoder. At the same time, a learnable position embedding is bound to each query vector set, and differentiated initialization is performed for different task types, which enhances the system's sensitivity to task characteristics and target positions. Compared with the prior art, this adaptive quantization method improves the accuracy and flexibility of queries and promotes information integration and utilization in the feature decoding process.
[0046] 4. Feature decoding module It includes multiple Transformer decoders, which decode the global feature information generated by the feature encoding module into target feature information related to the current specific task based on the specific task quantified in the task control module; according to the specific task quantified in the task control module, specify the output unit for the obtained target feature information to obtain output information, and the output information includes feature vectors, global probability maps, local probability maps and calibration boxes; the above output information is stored in the blockchain trusted storage module through the blockchain interaction module with smart contracts and chain codes as the medium; the module uses smart contracts and chain codes as the medium, and determines whether the blockchain trusted storage module has historical information of the same target through the blockchain interaction module, and the historical information includes feature vectors, global probability maps, local probability maps and calibration boxes. If so, they are returned to the user together, and if not, only the current output information of the module is returned to the user.
[0047] like Fig.10 As shown, in the decoder, based on the global feature information The coordinates of the image patch embedding relative to the original image , mapping to get its corresponding position embedding , the position embedding of the same task query set The two layers are input into the cross attention layer together, and the weighted output is obtained after linear transformation and attention weight calculation; the output of the cross attention layer is residually connected to the input, and then the result is normalized and input into the self-attention layer for attention calculation; the output of the self-attention layer is residually connected to the input, and then the result is normalized and input into the multi-layer perceptron; the multi-layer perceptron performs nonlinear transformation through multiple layers of fully connected layers and outputs the processed feature vector; if there is still a decoder in the follow-up, the output of the multi-layer perceptron will be further passed to the next decoder; finally, the target feature information related to the decoded task is obtained , mathematically there is ,in Refers to The output of a decoder.
[0048] like Fig.12As shown, in particular, the feature decoding module provided by the embodiment of the present invention includes four output units, namely, a feature vector output unit, a global probability map output unit, a local probability map output unit and a calibration frame output unit; wherein the global probability map output unit, the local probability map output unit and the calibration frame output unit need to be output to a multi-layer perceptron, and after a series of linear transformations and nonlinear activation functions, the final output representation is obtained; all tasks activate the feature vector output unit; in addition, the target semantic segmentation task and the target posture estimation task also need to activate the local probability map output unit and the global probability map output unit, the target detection task also needs to activate the global probability map output unit and the calibration frame output unit, and the target attribute recognition also needs to activate the global probability map output unit; the feature vectors, global probability maps, local probability maps and calibration frame information output by the above output units are all stored in the blockchain interaction module through the blockchain interaction module with smart contracts and chain codes as the medium.
[0049] 5. Blockchain trusted storage module It includes multiple nodes, which form a blockchain. All nodes have a consistent blockchain ledger locally, which is used to store the encrypted information output by the blockchain interaction module. The information includes feature vectors, global probability maps, local probability maps and calibration frames. The decentralized, trusted and traceable structural characteristics of the blockchain ensure that the encrypted information cannot be tampered with. The nodes are all trusted nodes by default, that is, nodes that can participate in blockchain interaction. If a node repeatedly inserts fabricated information, the node is updated to an untrusted node according to a reputation-based blockchain node election mechanism. The reputation-based blockchain node election mechanism regularly selects the node with the highest reputation as the leading node, and prevents nodes with a low reputation below a set threshold from participating in blockchain interaction, so as to avoid untrusted nodes from storing fabricated information. like Figure 6 As shown, in particular, a method for implementing a reputation-based blockchain node election mechanism provided by an embodiment of the present invention is as follows: (1) For each node in the blockchain interaction module, a pair of public and private keys is created using the national secret SM2 elliptic curve algorithm, the private key is returned to the user for local storage, and a digital signature is generated based on the public key and broadcast to other nodes in the blockchain. All hash SHA256 algorithms are replaced by the national secret SM3 hash algorithm; (2) When deploying the blockchain in the blockchain interaction model, the public keys, digital signatures, and initial reputation values of all nodes are stored in the genesis block. When a new node joins the blockchain, its public key and digital signature need to be packaged into the transaction through the smart contract and chain code and stored in the blockchain; (3) In the proof phase, the leader node election algorithm is executed to initialize the leader node set. The node that wants to be elected as the leader node calculates a random number through the VRF verifiable random function With a certificate of credibility If the reputation value of the node is non-negative, the node is considered eligible to run for the leadership node and is added to the leadership node candidate list, which is mathematically expressed as ,in It is the node's identifier; eventually, the node's digital signature, public key, random number generated by VRF, and reputation proof are broadcast to other nodes; VRF is a special algorithm that can determine low-reputation nodes and verify random functions; (4) In the verification phase, when a node receives information such as digital signatures, public keys, random numbers generated by VRF, and reputation certificates broadcasted by other nodes, it verifies whether the received random numbers and reputation certificates are credible based on the VRF verifiable random function. If they are credible, the node is recognized to join the candidate list of leader nodes, which can be expressed mathematically as , if it is untrustworthy, the reputation value of the node will be reduced; (5) Finally, the node with the highest random value in the leader node candidate list is selected as the leader node.
[0050] The above process ensures that low-reputation nodes cannot become leader nodes, and the leader node election process is unpredictable and fair enough.
[0051] It should be noted that the reputation-based blockchain node election mechanism proposed in the embodiment of the present invention innovatively combines the national secret SM2 elliptic curve algorithm and the VRF verifiable random function, giving nodes in the blockchain network a dynamically assessable reputation value, and introducing random numbers for the election of leading nodes. This mechanism can not only respond quickly when malicious behavior is discovered and effectively curb the behavior of fabricating information, but also the random number mechanism can ensure that among the trusted nodes, high-reputation nodes will not repeatedly become leading nodes, thereby ensuring the fairness of the election. Compared with the prior art, the election mechanism of the embodiment of the present invention is more fair and transparent, and can more accurately identify and exclude potential risk nodes, thereby maintaining the purity of the distributed network and providing a solid guarantee for the data security and stable operation of the complex fusion network training system.
[0052] like Figure 7 As shown, the blockchain trusted storage module also adopts a hash graph-based blockchain consensus algorithm to ensure the data consistency of the blockchain ledgers locally existing in each node.
[0053] The process of the blockchain consensus algorithm based on hash graph is as follows: (1) Create an empty hash map copy locally on all nodes, such as Figure 8As shown in the figure, the root node on the vertical axis of the hash graph represents each node in the blockchain, and the other nodes on the vertical axis represent the blocks generated on the corresponding root node. The block data structure contains two hash pointers pointing to the parent block. The entire hash graph structure is constructed based on the two hash pointers of each block, and the blocks are divided according to the round R to which they belong. (2) Each node maintains a copy of the hash graph of each blockchain node through the Gossip protocol; each node attempts to initiate a Gossip request to randomly find other nodes and synchronize the local hash graph copy through the Gossip protocol; (3) The node that receives the Gossip request creates a new block in the local hash graph copy and points the two hash pointers in the block to its own last block and the last block of the Gossip source node; (4) Create rounds for all blocks in the hash graph replica and determine whether the block is a witness block in that round; (5) Conduct virtual voting on all known witness blocks to elect well-known witness blocks; (6) Determine the consensus order of all blocks through well-known witness blocks and complete the consensus process; The witness block refers to the first block created on each node in round R of the hash graph replica; The well-known witness block refers to a block whose witness block in round R of the hash graph replica is strongly visible to more than two-thirds of the witness blocks in round R+1; The block strong visibility mentioned above means that the set of all paths from block A to block B in the hash graph copy covers more than two-thirds of the number of nodes; The round allocation creation refers to the rounds are divided into creation rounds and acceptance rounds. The creation round is the round in which a block is created, and generally belongs to the same round as its parent block; the acceptance round means that when a block can see more than two-thirds of the witness blocks of this round, the block will be promoted by one round; The virtual voting refers to the election process of well-known witnesses. The witness blocks of round r+1 vote on the witness blocks of round r. According to the definition of rounds, the witness blocks of round r+2 can see most of the witness blocks of round r+1, so the witness blocks of round r+2 count the votes of the witness blocks of round r+1, thus determining the final voting result. The above blocks all refer to blocks in the blockchain.
[0054] In the blockchain trusted storage module, there are four types of transactions: The first is an information storage transaction, which is responsible for executing a chain-driven encryption method on the global feature information output by the feature encoding module and the specific information generated by each output unit in the feature decoding module, and storing the encrypted information in the blockchain trusted storage module, so as to ensure the privacy of the specific information output by the target visual computing network; The second type is the query transaction, which is responsible for initiating queries to other nodes in the blockchain to verify whether the target corresponding to the currently stored encrypted information has encrypted information already stored in the blockchain, so as to achieve maximum effective knowledge sharing; The third type is to confirm the transaction, which is responsible for responding to the query transaction initiator node to check whether the target corresponding to the encrypted information of the transaction has been stored in the blockchain before. If so, the query transaction initiator node will be responded to, otherwise, no response will be given. The fourth type is the information transmission transaction, which is responsible for extracting the encrypted information previously stored in the blockchain by the target, decrypting it according to the chain-driven encryption algorithm, and sending it to the initiating node of the query transaction.
[0055] It should be noted that the hash graph-based blockchain consensus algorithm of the embodiment of the present invention can significantly reduce the consumption of network bandwidth and the risk of consensus failure caused by network delays or malicious behavior by building a copy of the hash graph and using the Gossip protocol for inter-node synchronization. Compared with the prior art, the consensus algorithm of the embodiment of the present invention provides a more efficient and stable consensus and transaction verification solution for the complex fusion network training system based on blockchain.
[0056] 6. Blockchain interaction module Based on smart contracts and chain codes, blockchain transactions are initiated to achieve intercommunication between the target visual computing network and the blockchain in the blockchain trusted storage module; this module is responsible for encrypting the feature vectors, global probability maps, local probability maps and calibration boxes that need to be stored in the blockchain by the feature decoding module in the target visual computing network based on a chain-driven encryption method and packaging them into blockchain transactions, and then sending them to the blockchain trusted storage module; this module is responsible for packaging the encrypted information that has been stored in the blockchain in the blockchain trusted storage module into blockchain transactions and returning them to the feature decoding module. This information includes feature vectors, global probability maps, local probability maps and calibration boxes.
[0057] like Figure 5 As shown, in the blockchain interaction module, a chain-driven encryption method is used to encrypt all information that needs to be written into the blockchain trusted storage module, including the feature vector, global probability map, local probability map and calibration frame information output by the feature decoding module; The chain-driven encryption method includes a group encryption mechanism, a group decryption mechanism, a trusted transmission mechanism, and a distributed defense mechanism. The group encryption mechanism and the group decryption mechanism cooperate with each other to realize the encryption and decryption of information. Through the trusted transmission mechanism, the information is packaged into a blockchain transaction between the node and the blockchain interaction module for transmission, and the distributed defense mechanism is relied on to overcome the replay attack problem existing in the blockchain technology; the encrypted information stored in the blockchain is encrypted by the group encryption mechanism when it is stored, and the group decryption mechanism is used to restore the ciphertext when it is retrieved; the trusted transmission mechanism is a mechanism that ensures that the process of transmitting information to the blockchain will not be attacked when the node initiates an access command to the blockchain; the distributed defense mechanism can solve the problem of replay attacks; the trusted transmission mechanism, the distributed defense mechanism, and the encryption and decryption mechanism jointly ensure the overall security of the blockchain contained in the target feature chain; In the block cipher encryption mechanism, the node The corresponding camera sends video data to the target visual computing network. After calculation, the information to be encrypted is sent to the blockchain interaction module through smart contracts and chain codes. After receiving this information, the smart contract and chain code obtain the corresponding SM4 group symmetric encryption algorithm key according to the node identity, and execute the SM4 group symmetric encryption algorithm on the information to be encrypted, and store the encrypted information in the blockchain trusted storage module through information storage transactions; In the packet decryption mechanism, the node Request to obtain the historical feature information of the target stored in the blockchain, node Send a query transaction to the blockchain interaction module using smart contracts and chain codes as the medium to request this information. In response to this transaction, the smart contract and chain code are used as the medium to send the confirmation transaction to the response node in the blockchain interaction module. There is historical feature information stored in the blockchain in the past; after confirming that the transaction is completed, the node Obtain the key of the corresponding SM4 group symmetric encryption algorithm according to the node identity, perform the SM4 group symmetric encryption algorithm to decrypt the historical feature information previously stored in the blockchain, send the information transmission transaction to the blockchain interaction module based on the smart contract and chain code, and return the decrypted information to the node .
[0058] In the trusted transmission mechanism, the TLS protocol is deployed for all nodes, and corresponding TLS encryption certificates are generated for all nodes through the national secret SM2 elliptic curve algorithm to defend against active attacks during the transmission process; specifically, in the transaction payload Payload of each blockchain transaction initiated based on smart contracts and chain codes, the TLS encryption certificate corresponding to the node must be carried in order to be successfully initiated.
[0059] In the distributed defense mechanism, a random number Nonce (block header transaction random number) is deployed in the blockchain transaction payload of each blockchain transaction. The blockchain processes transactions according to the positive order of Nonce values. When a transaction with an incorrect Nonce value order is found, the transaction is placed in the pending transaction memory pool, waiting for the arrival of the correct transaction, thereby overcoming the replay attack of the distributed system.
[0060] It should be noted that the chain-driven encryption algorithm of the above-mentioned embodiment of the present invention integrates a block encryption and decryption mechanism, a trusted transmission mechanism, and a distributed defense mechanism, which provides a more comprehensive and efficient data protection solution compared to the existing technology. The block encryption and decryption mechanism ensures the high confidentiality of data during the storage and transmission of the blockchain; the trusted transmission mechanism effectively resists man-in-the-middle attacks and ensures the integrity and authenticity of data transmission; and the distributed defense mechanism provides a powerful solution to the replay attack problem unique to the blockchain. The three work together to not only improve the overall security of the blockchain network, but also promote the reliable circulation and utilization of data in complex fusion network training systems, thereby improving the availability and practicality of the system.
[0061] like Figure 2 As shown, in particular, the adaptive loss function in the embodiment of the present invention is obtained by combining several sub-loss functions with a group of control circuit gates; the several sub-loss functions include a decoding loss function, a segmentation loss function, a regression loss function, a detection loss function and a classification loss function; the above-mentioned various loss functions are obtained by controlling a group of control gates according to the task type; The decoding loss function is used to supervise the output information in the feature decoding module and correct the difference between the input and the decoding output of the global feature information according to the task type and the target type; The segmentation loss function is used to measure the overlap between the predicted segmentation area and the actual segmentation in the two tasks of target semantic segmentation and target detection; The regression loss function is used to calculate the error between the predicted value and the true value in the two tasks of target posture estimation and target detection; The detection loss function is a loss function used to deal with the category imbalance problem in the target detection task, emphasizing the training of the detected difficult-to-classify targets; specifically, in the detection loss function, the balance factor of the focus loss part is set , thus focusing on the training of hard-to-classify targets; The classification loss function is used to correct the error between the predicted calibration frame corresponding to the global feature information and the real calibration frame (the predicted calibration frame is the calibration frame output by the feature decoding module) in the three tasks of target re-identification, target attribute recognition, and target semantic segmentation; The metric loss function is used to correct the distance between the detection sample and the positive and negative samples in the feature space in the target re-identification task; the positive samples are close to each other, and the negative samples are far away from each other; the samples are target pedestrians or target vehicles, the positive samples are the same target, and the negative samples are different targets; The control gate is used to configure one or a combination of the five corresponding loss functions for the target visual computing network according to the task type and the target type, so as to realize an adaptive loss function; specifically, it includes three levels of control gates, the first level control gate includes a pedestrian target gate and a vehicle target gate to control the parameter setting for selecting the correct object; the second level control gate includes five types of target re-identification gate, target attribute recognition gate, target semantic segmentation gate, target posture estimation gate, and target detection gate to control the parameter design for selecting the correct task; the third level control gate allocates an adaptive loss function to the system according to the results of the first two levels of control gates and the target type and task type to realize an adaptive loss function.
[0062] It should be noted that the adaptive loss function design of the embodiment of the present invention realizes adaptive adjustment for different task types by combining multiple seed loss functions such as decoding, segmentation, regression, detection and classification, and introducing a control circuit gate mechanism. This design not only improves the flexibility and accuracy of the loss function, but also effectively responds to challenges such as category imbalance and sample differences, thereby optimizing the training effect of the target visual computing network. Compared with the prior art, the loss function of the present invention can more accurately reflect task requirements, promote the performance improvement of the model in complex scenarios, and achieve better training effects and practical application effects.
[0063] like Fig.11 As shown, in particular, an embodiment of the present invention provides a complex fusion network training method based on blockchain, including a target visual computing network and a target feature chain, which is implemented as follows: (1) Extract target frames from target surveillance video; (2) Preprocess the target frame and learn a position embedding with consistent dimensions, optimize it layer by layer in the Transformer encoder, obtain the encoded global feature information, and input it into the decoder; (3) The user inputs the task type and selects the target type. The embedding layer quantizes the task into the corresponding embedding and its position embedding according to the adaptive quantization method and inputs it into the decoder. (4) Based on the quantized task, the global feature information of the target is decoded into target feature information related to the specific task based on the Transformer decoder; (5) According to the quantized task, the output unit is specified for the obtained target feature information to obtain the task-related feature information, which is sent to the target feature chain for storage and synchronously returned to the user; (6) The target feature chain processes the feature information output by the feature decoding module based on the smart contract and chain code. First, the feature information is encrypted according to the block encryption mechanism of the chain-driven encryption method. Then, the encrypted information is packaged into information storage transactions for transmission according to the trusted transmission mechanism of the chain-driven encryption algorithm. The distributed defense mechanism of the chain-driven encryption algorithm is used to overcome the replay attack problem existing in blockchain technology. (7) After receiving the information storage transaction, the transaction is sorted by consensus based on a hash graph-based blockchain consensus algorithm, and a leader node is selected based on a reputation-based blockchain node election mechanism. The transaction is packaged into blocks and stored in the blockchain to complete the information storage transaction process; (9) If the user specifies that the historical feature information of the target that has been stored in the blockchain needs to be obtained, a Boolean mark is sent to the decoder. When the Boolean mark is true, the decoder sends the output feature vector separately to the target feature chain; (10) The target feature chain processes the feature vector output by the feature decoding module based on the smart contract and chain code, packages the feature vector into a query transaction based on the trusted transmission mechanism of the chain-driven encryption algorithm, and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism; (11) The node in the blockchain that wants to respond to the query transaction obtains the corresponding feature vector from the block corresponding to the query transaction, calculates the cosine similarity between the feature vector and its own feature vector previously stored in the blockchain based on the smart contract and chain code, and determines whether the target corresponding to the encrypted information previously stored has encrypted information already stored in the blockchain; if not, it does not respond to the query transaction initiating node; if so, it initiates a confirmation transaction to the query node and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism; (12) After the transaction is confirmed to be completed, the node in the blockchain that needs to respond to the query transaction extracts the encrypted information that has been stored in the blockchain from the target feature chain through the blockchain interaction module, and decrypts the encrypted information based on the smart contract and chain-driven encryption algorithm, packages it into an information transmission transaction, and completes the transaction based on a hash graph-based blockchain consensus algorithm and a reputation-based blockchain node election mechanism, returning the decrypted information to the decoder in the target visual computing network, and finally returning it to the user.
[0064] The relevant execution process in the above method is similar to the system provided in the embodiment of the present invention.
[0065] Based on the same inventive concept, another embodiment of the present invention also provides an electronic device (including a computer, a server, a smart phone, etc.), which includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes a system for executing the steps and systems in the above-mentioned method provided in the embodiment of the present invention.
[0066] Based on the same inventive concept, another embodiment of the present invention further provides a computer-readable storage medium (such as ROM / RAM, disk, CD), wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the various steps and systems of the method provided in the above embodiment of the present invention are implemented.
[0067] The above embodiments are provided only for the purpose of describing the present invention, and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims. Various equivalent substitutions and modifications made without departing from the spirit and principles of the present invention should all be included within the scope of the present invention.
Claims
1. A complex fusion network training system based on blockchain, characterized by: Including target visual computing network and target feature chain; The target visual computing network performs parallel pre-training on target frames in the collected target surveillance video based on public data sets and adaptive loss functions for different task types in multiple tasks, calculates target feature information related to the current specific task type, and stores the target feature information in the target feature chain through smart contracts and chain codes; the target feature chain stores encrypted target feature information to ensure the security and privacy of the target feature information; the target feature chain decrypts the encrypted target historical feature information through smart contracts and chain codes and sends it to the target visual computing network; The multiple tasks are determined by the user according to the needs of the user; and the multiple tasks can be independently executed for two target types, pedestrians and vehicles; the different task types among the multiple tasks are target posture estimation, target semantic segmentation, target detection, target re-identification and target attribute recognition.
2. The complex fusion network training system based on blockchain according to claim 1 is characterized in that: The target visual computing network includes a monitoring video acquisition module, a feature encoding module, a task control module, and a feature decoding module: the target feature chain includes a blockchain trusted storage module and a blockchain interaction module; The monitoring video acquisition module is composed of multiple cameras that do not contain overlapping areas, and each camera exists as a node alone; Collecting target surveillance video, and extracting target frames from the target surveillance video and inputting them into a feature encoding module; The feature encoding module pre-processes the target frame to obtain a set of scaled target frames of fixed size; Based on the scaled target frame, a position embedding with consistent dimension is learned, the position embedding is interpolated, and the position embedding is input together with the scaled target frame group into multiple Transformer encoders for layer-by-layer optimization to obtain encoded global feature information, and the encoded global feature information is input into a feature decoding module; The task control module: adopts an adaptive target quantization method to perform adaptive quantization according to specific task types, target types, and queries in multiple tasks, and quantizes each task into a corresponding embedding and its position embedding input into the feature decoding module; The multiple tasks share a feature encoding module and a feature decoding module, and the quantization process of each task is independent of each other and does not interfere with each other. The feature decoding module can be used to simultaneously determine the feature information related to the current task in the global feature information, thereby realizing parallel quantization processing of the multiple tasks and synchronously inputting them into the feature decoding module; The feature decoding module includes a plurality of Transformer decoders, which decode the global feature information generated by the feature encoding module into target feature information related to the current specific task according to the specific task quantified in the task control module, and further specify an output unit for the obtained target feature information to obtain output information; the output information includes a feature vector, a global probability map, a local probability map and a calibration box; The blockchain trusted storage module includes multiple nodes, which form a blockchain. All nodes have a consistent blockchain ledger locally, which is used to store the encrypted information output by the blockchain interaction module. The encrypted information has the structural characteristics of blockchain decentralization, trustworthiness, and traceability, ensuring that the encrypted information cannot be tampered with. The blockchain interaction module initiates blockchain transactions based on smart contracts and chain codes to achieve intercommunication between the target visual computing network and the blockchain in the blockchain trusted storage module.
3. A complex fusion network training system based on blockchain according to claim 1 or 2, characterized in that: The adaptive loss function is obtained by combining several sub-loss functions with a group of control circuit gates; the several sub-loss functions include a decoding loss function, a segmentation loss function, a regression loss function, a detection loss function and a classification loss function; one or a combination of the above-mentioned various loss functions is obtained by controlling a group of control gates according to the task type; The decoding loss function is used to supervise the output information in the feature target visual computing network and correct the difference between the input and the decoding output of the global feature information according to the task type and the target type; The segmentation loss function is used to measure the overlap between the predicted segmentation area and the actual segmentation in the two tasks of target semantic segmentation and target detection; The regression loss function is used to calculate the error between the predicted value and the true value in the two tasks of target posture estimation and target detection; The detection loss function is a loss function used to deal with the category imbalance problem in the target detection task, emphasizing the training for the detected difficult-to-classify targets; The classification loss function is used to correct the error between the predicted calibration box and the real calibration box corresponding to the global feature information in the three tasks of target re-identification, target attribute recognition, and target semantic segmentation; The metric loss function is used to correct the distance between the detection sample and the positive and negative samples in the feature space in the target re-identification task; The samples are target pedestrians or target vehicles, the positive samples are the same target, and the negative samples are different targets.
4. According to claim 2, a complex fusion network training system based on blockchain is characterized in that: In the task control module, the query method is as follows: the target posture estimation task is a task specific to pedestrian targets, the target semantic segmentation task is responsible for segmenting the human body structure for pedestrian targets, and is responsible for separating each vehicle instance from the background for vehicle targets, and the target attribute recognition task is responsible for recognizing specific attributes of pedestrians for pedestrian targets, and is responsible for recognizing specific attributes of vehicles for vehicle targets; The query is determined by the task type and the target type. For pedestrian targets, the query for target pose estimation is the pose joint points, and the query number is the number of pose joint points; the query for target semantic segmentation is the pedestrian semantic segmentation category, and the query number is the number of semantic segmentation categories; the query for target detection is the size of the detected target at different anchor points, and the query number is the number of anchor points; the query for target re-identification corresponds to the dimension of the re-identification feature; The query for target attribute recognition is the type of pedestrian attribute, and the query quantity is the number of pedestrian attributes; for vehicle targets, the quantitative definition of target detection and target re-identification tasks is the pedestrian target; There is no target pose estimation task for vehicle targets; the query for target semantic segmentation is the vehicle semantic segmentation category, and the number of queries is the number of semantic segmentation categories; The query for target attribute recognition is the type of vehicle attribute, and the query quantity is the number of vehicle attributes.
5. According to claim 2, a complex fusion network training system based on blockchain is characterized in that: In the task control module, the adaptive quantization method is implemented as follows: (1) First, initialize all input tasks into a set of task-related queries ,in is the number of queries related to the corresponding task, Represents the content of each specific query; (2) Then, the query set corresponding to all the input tasks is Randomly initialized to a learnable embedding , optimized layer by layer in all Transformer encoders in the feature decoding module; (3) Finally, for each query vector set Binding a learnable position embedding , where for the four tasks of target pose estimation, target semantic segmentation, target re-identification, and target attribute recognition, the corresponding For the target detection task, the corresponding Initialized as a map of anchors uniformly distributed in the target frame; learnable position embeddings Shared among all Transformer decoders in a feature decoding module.
6. The complex fusion network training system based on blockchain according to claim 2 is characterized in that: In the feature decoding module, corresponding to the output information, the feature decoding module output units include four types, namely, feature vector output unit, global probability map output unit, local probability map output unit and calibration frame output unit; wherein all tasks activate the feature vector output unit; in addition, the target semantic segmentation task and the target posture estimation task also need to activate the local probability map output unit and the global probability map output unit, the target detection task also needs to activate the global probability map output unit and the calibration frame output unit, and the target attribute recognition also needs to activate the global probability map output unit.
7. A complex fusion network training system based on blockchain according to claim 2, characterized in that: In the blockchain trusted storage module, all nodes are by default trusted nodes, i.e. nodes participating in blockchain interactions. If a node repeatedly inserts fabricated information, the node is updated to an untrusted node according to a reputation-based blockchain node election mechanism. The implementation method of the reputation-based blockchain node election mechanism is as follows: (1) Create a pair of public and private keys for each node in the blockchain interaction module using the national secret SM2 elliptic curve algorithm, generate a digital signature based on the public key, and broadcast it to other nodes in the blockchain; (2) When deploying the blockchain in the blockchain interaction model, the public keys, digital signatures, and initial reputation values of all nodes are stored in the genesis block. When a new node joins the blockchain, its public key and digital signature need to be packaged into the transaction through the smart contract and chain code and stored in the blockchain; (3) Execute the leader node election algorithm. The node that wants to be elected as the leader node obtains a random number and a reputation certificate through the VRF verifiable random function. If the reputation value of the node is non-negative, the node is considered eligible to run for the leader node and is added to the leader node candidate list. Finally, the node's digital signature, public key, random number generated by VRF, reputation certificate and other information are broadcast to other nodes. The VRF is a special algorithm that can determine low-reputation nodes and verify random functions. (4) When a node receives information such as digital signatures, public keys, random numbers generated by VRF, and reputation certificates from other nodes, it verifies whether the received random numbers and reputation certificates are credible based on the VRF verifiable random function. If they are credible, the node is recognized to be included in the candidate list of leader nodes. If they are not credible, the node’s reputation value is reduced. (5) Finally, the node with the highest random value in the leader node candidate list is selected as the leader node.
8. A complex fusion network training system based on blockchain according to claim 2, characterized in that: In the blockchain trusted storage module, a hash graph-based blockchain consensus algorithm is also used to ensure the data consistency of the blockchain ledgers locally stored in each node; The process of the blockchain consensus algorithm based on hash graph is as follows: (1) Create an empty hash graph copy locally on all nodes. The root node on the vertical axis of the hash graph represents each node in the blockchain, and the other nodes on the vertical axis represent the blocks generated on their corresponding root nodes. The block data structure contains two hash pointers pointing to the parent block. (2) Each node maintains a copy of the hash graph of each blockchain node through the Gossip protocol; Each node randomly finds other nodes and synchronizes the local hash graph copy through the Gossip protocol; (3) The node that receives the Gossip request creates a new block in the local hash graph copy and points the two parent hash pointers in the block to its own last block and the last block of the Gossip source node; (4) Create rounds for all blocks in the hash graph replica and determine whether the block is a witness block in that round; (5) Conduct virtual voting on all known witness blocks to elect well-known witness blocks; (6) Determine the consensus order of all blocks through well-known witness blocks and complete the consensus process; The witness block refers to the first block created on each node in round R of the hash graph replica; The well-known witness block refers to a block whose witness block in round R of the hash graph replica is strongly visible to more than two-thirds of the witness blocks in round R+1; The block strong visibility mentioned above means that the set of all paths from block A to block B in the hash graph copy covers more than two-thirds of the number of nodes; The round allocation creation refers to the rounds are divided into creation rounds and acceptance rounds. The creation round is the round in which a block is created, and generally belongs to the same round as its parent block; the acceptance round means that when a block can see more than two-thirds of the witness blocks of this round, the block will be promoted by one round; The virtual voting refers to the election process of well-known witnesses. The witness blocks of round r+1 vote on the witness blocks of round r. According to the definition of rounds, the witness blocks of round r+2 can see most of the witness blocks of round r+1. Therefore, the witness blocks of round r+2 count the votes of the witness blocks of round r+1 to determine the final voting results.
9. The complex fusion network training system based on blockchain according to claim 2 is characterized in that: In the blockchain trusted storage module, there are four types of blockchain transactions: The first is information storage transaction, which is responsible for encrypting the specific information generated by each output unit in the feature decoding module and storing the encrypted information in the blockchain trusted storage module to ensure the privacy of the output information of the target visual computing network; The second type is the query transaction, which is responsible for initiating queries to other nodes in the blockchain to verify whether the target corresponding to the currently stored encrypted information has encrypted information already stored in the blockchain, so as to achieve maximum effective knowledge sharing; The third type is to confirm the transaction, which is responsible for responding to the encrypted information of the initiating node of the query transaction to see whether the target corresponding to the encrypted information has been stored in the blockchain in the past. If so, the initiating node of the query transaction will be responded to, otherwise, no response will be given; The fourth type is the information transmission transaction, which is responsible for extracting the encrypted information previously stored in the blockchain by the target, decrypting it and sending it to the initiating node of the query transaction.
10. A complex fusion network training system based on blockchain according to claim 2, characterized in that: The blockchain interaction module encrypts the output information of the feature decoding module through the chain drive encryption algorithm and packages it into a blockchain transaction, and sends it to the blockchain trusted storage module; it is also responsible for decrypting the encrypted information stored in the blockchain in the blockchain trusted storage module through the chain drive encryption algorithm and packaging it into a blockchain transaction, and returning it to the feature decoding module; The chain-driven encryption algorithm includes a group encryption mechanism, a group decryption mechanism, a trusted transmission mechanism, and a distributed defense mechanism; the group encryption mechanism and the group decryption mechanism cooperate with each other to realize the encryption and decryption of information, and the information is packaged into a blockchain transaction between the node and the blockchain interaction module through the trusted transmission mechanism for transmission, and the distributed defense mechanism is used to overcome the replay attack problem existing in the blockchain technology; the encrypted information stored in the blockchain is encrypted by the group encryption mechanism when it is stored, and the group decryption mechanism is used to restore the ciphertext when it is retrieved; The trusted transmission mechanism is a mechanism that ensures that the process of transmitting information to the blockchain will not be attacked when the node issues access commands to the blockchain; the distributed defense mechanism can solve the problem of replay attacks; The trusted transmission mechanism, distributed defense mechanism, and encryption and decryption mechanism jointly ensure the overall security of the blockchain contained in the target feature chain.
11. A complex fusion network training method based on blockchain, characterized in that: (1) Extract target frames from target surveillance video; (2) Preprocess the target frame and learn a position embedding with consistent dimensions, optimize it layer by layer in the Transformer encoder, obtain the encoded global feature information, and input it into the decoder; (3) The user inputs the task type and selects the target type. The embedding layer quantizes the task into the corresponding embedding and its position embedding according to the adaptive quantization method and inputs it into the decoder. (4) Based on the quantized task, the global feature information of the target is decoded into target feature information related to the specific task based on the Transformer decoder; (5) According to the quantized task, the output unit is specified for the obtained target feature information to obtain the task-related feature information, which is sent to the target feature chain for storage and synchronously returned to the user; (6) The target feature chain processes the feature information output by the feature decoding module based on the smart contract and chain code. First, the feature information is encrypted according to the block encryption mechanism of the chain-driven encryption method. Then, the encrypted information is packaged into information storage transactions for transmission according to the trusted transmission mechanism of the chain-driven encryption algorithm. The distributed defense mechanism of the chain-driven encryption algorithm is used to overcome the replay attack problem existing in blockchain technology. (7) After receiving the information storage transaction, the blockchain consensus algorithm based on the hash graph will sort the transaction by consensus, and the leader node will be selected based on the reputation-based blockchain node election mechanism, and the transaction will be packaged into blocks and stored in the blockchain, completing the information storage transaction process; (8) If the user specifies that the historical feature information of the target that has been stored in the blockchain needs to be obtained, a Boolean mark is sent to the decoder. When the Boolean mark is true, the decoder sends the output feature vector separately to the target feature chain; (9) The target feature chain processes the feature vector output by the feature decoding module based on the smart contract and chain code, packages the feature vector into a query transaction based on the trusted transmission mechanism of the chain-driven encryption algorithm, and completes the transaction based on the blockchain consensus algorithm of the hash graph and the reputation-based blockchain node election mechanism; (10) The node in the blockchain that wants to respond to the query transaction obtains the corresponding feature vector from the block corresponding to the query transaction, calculates the cosine similarity between the feature vector and its own feature vector previously stored in the blockchain based on the smart contract and chain code, and determines whether the target corresponding to the encrypted information previously stored has encrypted information already stored in the blockchain; if not, it does not respond to the query transaction initiating node; if so, it initiates a confirmation transaction to the query node and completes the transaction based on the hash graph blockchain consensus algorithm and the reputation-based blockchain node election mechanism; (11) After the transaction is confirmed to be completed, the node in the blockchain that needs to respond to the query transaction extracts the encrypted information stored in the blockchain from the target feature chain through the blockchain interaction module, decrypts the encrypted information based on the smart contract and chain-driven encryption algorithm, packages it into an information transmission transaction, and completes the transaction based on the blockchain consensus algorithm based on the hash graph and the reputation-based blockchain node election mechanism, and returns the decrypted information to the decoder in the target visual computing network, and finally returns it to the user.
12. An electronic device, characterized in that: comprising a processor and a memory, wherein; Memory, used to store computer programs; A processor, configured to execute a computer program stored in a memory to implement the system described in any one of claims 1 to 10, or the method described in claim 11.
13. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the system according to any one of claims 1 to 10 or the method according to claim 11 is implemented.
Citation Information
Patent Citations
Vehicle illegal behavior detection system based on block chain and deep learning
CN111507270A
Model training method and device, face video generation method and device, equipment and medium
CN112966607A
Obstacle detection method for railway vehicle, computer equipment and storage medium
CN113936268A
Model processing method, system and equipment based on block chain and medium
CN115860115A
Cross-camera multi-target tracking system and method based on tracking chain
CN118314172A
