A method and system for detecting antibody drug residues based on image recognition
The method addresses the challenges of detecting antibody drug residues by preprocessing images with median filtering and geometric transformations, using convolutional and recursive neural networks to enhance feature extraction and temporal processing, resulting in faster and more accurate residue detection.
Patent Information
- Application Number
- CN202411463533.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Existing image recognition technologies struggle with insufficient accuracy and slow processing speed when detecting complex and tiny antibody drug residues, particularly in pharmaceutical production, due to inadequate preprocessing, feature extraction, and lack of temporal feature processing, leading to misjudgments and potential safety threats.
A method involving image preprocessing with median filtering and random geometric transformations, followed by convolutional and recursive neural networks to extract deep features, capture temporal dependencies, and refine classification scores for accurate residue detection.
Enhances image consistency, speeds up processing, and significantly improves detection accuracy and reliability by effectively distinguishing residue categories through enhanced feature extraction and temporal feature processing.
Smart Images

Figure CN119007198B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to an antibody drug residue detection method and system based on image recognition. Background Art
[0002] The field of image recognition technology involves the use of algorithms and mathematical models to interpret and understand data in images. The core of this field is the development of computer systems that can automatically recognize and classify data from images. Image recognition technology has a wide range of applications, ranging from simple object recognition to complex scene understanding. This technology is often used in security monitoring, medical imaging, self-driving cars, robot navigation and other fields. Technological advances mainly include improving recognition accuracy, accelerating processing speed, and optimizing algorithms to handle more complex image features.
[0003] Among them, the antibody drug residue detection method based on image recognition refers to the use of image recognition technology to detect and analyze antibody drug residues in the pharmaceutical field. This method analyzes the images generated during the drug processing process to identify the presence or absence of drug residues, thereby helping to ensure the quality and safety of the product. It has a wide range of uses and can be applied to fields such as drug production quality control, preclinical research safety assessment, and environmental monitoring, which is of great significance for protecting public health and drug safety.
[0004] Although existing image recognition technologies are widely used in many fields, they often suffer from insufficient recognition accuracy and slow processing speed when dealing with complex and tiny residue images that are unique to the pharmaceutical field. Due to the lack of targeted preprocessing and optimized feature extraction processes, traditional methods often have difficulty accurately distinguishing normal from abnormal images when faced with complex backgrounds and ever-changing residue forms. In addition, the lack of an effective temporal feature processing mechanism makes it difficult to capture residue changes in the continuous production process in a timely manner, resulting in delays in the identification of new or mutant residues. This technical limitation is particularly prominent on pharmaceutical production lines that require high speed and high precision, which may lead to misjudgments, thereby affecting the quality of the entire batch of drugs, increasing the company's economic losses, and even threatening public health and safety. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an antibody drug residue detection method and system based on image recognition.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: a method for detecting antibody drug residues based on image recognition, comprising the following steps:
[0007] S1: Based on the collected antibody drug residue image data, each pixel value of the image is linearly scaled to a range of 0 to 1, a median filter is applied to each pixel, the current pixel value is replaced by the median of the adjacent pixels, and then a 15-degree random rotation and a 90% to 110% random scaling are applied to the image to obtain a preprocessed image data set;
[0008] S2: Based on the preprocessed image data set, the image is passed through multiple convolution layers in sequence, each layer uses a 3×3 convolution kernel to extract image features, and the feature map is activated using the ReLU function. After each convolution, a 2×2 maximum pooling operation is performed to reduce the feature dimension, and all the obtained feature maps are spliced in the depth direction to form a fused convolution feature set;
[0009] S3: After serializing the fused convolutional feature set, the fused convolutional feature set is input into the recursive neural network layer by layer. The feature map of each layer is updated by calculating the weighted sum with the previous hidden state, using the gating mechanism to record the hidden state of each time step, and obtaining the feature representation after recursive processing.
[0010] S4: Apply corresponding weights to each hidden state in the feature representation after the recursive processing to perform weighted sum calculation to form a global feature vector, input the global feature vector to the classification layer, calculate the score of each category, determine the residue category to which the image belongs according to the size of the score, and obtain the antibody drug residue detection result.
[0011] As a further solution of the present invention, the step of acquiring the preprocessed image data set is specifically:
[0012] S111: collecting antibody drug residue image data, adjusting each pixel value in the image to between 0 and 1 through a linear transformation algorithm to normalize the data range, and generating normalized image data;
[0013] S112: applying median filtering to the normalized image data, replacing the image data with the median of the pixel values around each pixel to reduce image noise, and obtaining image data after median filtering;
[0014] S113: geometrically transform the image data after the median filtering, including rotation at a random angle and random scaling between 90% and 110%, using the formula:
[0015] and ;
[0016] Generate a preprocessed image dataset;
[0017] in, represents the random rotation angle, represents the original pixel coordinates, Represents the new pixel coordinates after rotation.
[0018] As a further solution of the present invention, the steps of obtaining the fused convolution feature set are specifically as follows:
[0019] S211: input the preprocessed image data set into the deep learning model, apply multiple 3x3 convolution kernels to each image, perform convolution operation to extract basic image features, and obtain a preliminary feature map;
[0020] S212: Applying an activation function ReLU to the preliminary feature map to enhance the nonlinear representation of features and eliminate negative values, thereby obtaining an activated feature map;
[0021] S213: Based on the activated feature map, the activated feature map is sent to a maximum pooling layer of size 2x2 to reduce the spatial dimension of the feature map and obtain a pooled feature map;
[0022] S214: splicing the pooled feature maps in the depth direction using the formula:
[0023] ;
[0024] Generate a fused convolution feature set;
[0025] in, Represents the weight of the feature map of the i-th layer, and adjusts the contribution of the optimized feature. Represents the feature map after multi-layer pooling, is the fused feature set.
[0026] As a further solution of the present invention, the step of obtaining the feature representation after the recursive processing is specifically:
[0027] S311: Serialize the fused convolution feature set, adjust the data format to match the input structure of the recursive neural network, and generate serialized feature data;
[0028] S312: Send the serialized feature data to the recursive neural network layer by layer, perform weighted sum calculation on each layer, combine the input feature with the previous hidden state, update it to the feature state of the current layer, and obtain the temporary feature state of each layer;
[0029] S313: combining the temporary feature state and the hidden state of the current layer, using a gating mechanism to update the hidden state, performing a gating update of the weighted sum, using the formula:
[0030] ;
[0031] Generate the adjusted hidden state at each time step;
[0032] in, is the gating coefficient, is the weight matrix, is the activation function, , , and Respectively represent the hidden state of the current time step, the previous time step, the current input feature and the bias term;
[0033] S314: Collect and combine the hidden states of all the time steps to form a continuous temporal feature representation, and generate a complete feature representation after recursive processing.
[0034] As a further embodiment of the present invention, the steps for obtaining the antibody drug residue detection result are specifically as follows:
[0035] S411: applying a corresponding weight to each hidden state in the recursively processed feature representation, calculating a weighted value of each hidden state by matrix multiplication, performing a product operation based on a vector of the hidden state and the weight matrix, obtaining a weighted feature representation, and generating an intermediate feature vector;
[0036] S412: Perform a weighted sum operation on the intermediate feature vector using the formula:
[0037] ;
[0038] Generate global feature vector;
[0039] in, is the global eigenvector, is the weight of the i-th hidden state, is the i-th hidden state, and To adjust the parameters affected by weights;
[0040] S413: inputting the global feature vector into the classification layer, calculating the score of each category based on linear transformation, performing score comparison operation, calculating the belonging probability of multiple categories, and generating a score vector for each category;
[0041] S414: Compare the size of the score vector of each category, determine the residue category to which the image belongs according to the maximum score, and obtain the antibody drug residue detection result.
[0042] An antibody drug residue detection system based on image recognition, the antibody drug residue detection system based on image recognition is used to perform the above-mentioned antibody drug residue detection method based on image recognition, the system comprises:
[0043] The image preprocessing module collects the image data of antibody drug residues, linearly scales each pixel value to the range of 0 to 1, performs median filtering, selects the median of adjacent pixels to replace the current pixel value, and then performs a 15-degree random rotation and a 90% to 110% random scaling on the image to generate a preprocessed image data set;
[0044] The feature extraction module takes the preprocessed image data set as input, processes the image layer by layer through multiple 3x3 convolution kernels, activates the output feature map of each layer using the ReLU function, performs a 2x2 maximum pooling operation after each convolution operation, splices all feature maps in the depth direction, and obtains a fused convolution feature set;
[0045] The feature serialization module serializes the fused convolution feature set and inputs it into the recursive neural network, processes the feature map layer by layer, updates the current state by weighted sum calculation with the previous hidden state, records the hidden state of each time step, and forms a feature representation after recursive processing;
[0046] The feature synthesis module applies corresponding weights to each hidden state in the feature representation after the recursive processing to perform weighted sum calculation and convert it into a global feature vector;
[0047] The classification decision module inputs the global feature vector into the classification layer, calculates the score of each category, compares the scores to determine the residue category to which the image belongs, and obtains the antibody drug residue detection result.
[0048] Compared with the prior art, the advantages and positive effects of the present invention are:
[0049] In the present invention, by applying median filtering and random geometric transformations such as rotation and scaling, the original image data can be processed more efficiently. This preprocessing step significantly enhances the consistency and quality of the image data. Subsequently, through layer-by-layer convolution and maximum pooling operations, not only the deep features of the image are extracted, but also the dimension of the data is greatly reduced, which speeds up the processing speed. In addition, by processing the serialized feature set through a recursive neural network, the temporal dependencies between the features are captured, which is particularly critical for understanding and classifying complex image content. The global feature vector formed by weighted and calculated, combined with the refined score calculation of the classification layer, greatly improves the accuracy and reliability of residual detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the workflow of the present invention;
[0051] Figure 2 A flowchart of the steps for obtaining the preprocessed image data set of the present invention;
[0052] Figure 3 Flow chart of the steps for obtaining the fused convolution feature set of the present invention;
[0053] Figure 4 A flow chart of the steps for obtaining feature representation after recursive processing of the present invention;
[0054] Figure 5 The figure is a flow chart of the steps for obtaining the antibody drug residue detection results of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0057] Example: See Figure 1 The present invention provides a technical solution: a method for detecting antibody drug residues based on image recognition, comprising the following steps:
[0058] S1: Based on the collected antibody drug residue image data, each pixel value of the image is linearly scaled to a range of 0 to 1, a median filter is applied to each pixel, the current pixel value is replaced by the median of the adjacent pixels, and then a 15-degree random rotation and a 90% to 110% random scaling are applied to the image to obtain a preprocessed image data set;
[0059] S2: Based on the preprocessed image dataset, the image is passed through multiple convolutional layers in sequence. A 3×3 convolution kernel is used in each layer to extract image features. The ReLU function is used to activate the feature map. After each convolution, a 2×2 maximum pooling operation is performed to reduce the feature dimension. All the obtained feature maps are spliced in the depth direction to form a fused convolution feature set.
[0060] S3: After serialization, the fused convolutional feature set is input into the recursive neural network layer by layer. The feature map of each layer is calculated by weighted sum with the previous hidden state, and the current state is updated using a gating mechanism. The hidden state of each time step is recorded to obtain the feature representation after recursive processing.
[0061] S4: Apply the corresponding weight to each hidden state in the feature representation after recursive processing to perform weighted sum calculation to form a global feature vector, input the global feature vector to the classification layer, calculate the score of each category, determine the residue category to which the image belongs based on the size of the score, and obtain the antibody drug residue detection result.
[0062] The preprocessed image dataset includes adjusted pixel values, filtering results, and enhanced image samples. The fused convolution feature set includes feature extraction results, activation features, and dimensionality reduction features. The feature representation after recursive processing includes time series features, state updates, and hierarchical dependencies. The antibody drug residue detection results are specifically category recognition, score ranking, and predicted category.
[0063] See also Figure 2 , the steps for obtaining the preprocessed image dataset are as follows:
[0064] S111: collecting antibody drug residue image data, adjusting each pixel value in the image to between 0 and 1 through a linear transformation algorithm to normalize the data range, and generating normalized image data;
[0065] Antibody drug residue image data was collected, and a linear transformation algorithm was applied to adjust the value of each pixel in the image so that it was between 0 and 1, standardizing the range of image data and providing a unified benchmark for image processing. At the same time, this normalization process also helps the application of other image processing techniques, including filtering and image enhancement, because the unified data range can reduce the interference of outliers in the execution of the algorithm. This process not only improves the image quality, but also improves the accuracy and efficiency of the image processing algorithm in subsequent steps, and obtains normalized image data.
[0066] S112: applying median filtering to the normalized image data, replacing the image data with the median of the pixel values around each pixel to reduce image noise, and obtaining image data after median filtering;
[0067] The normalized image data is processed by median filtering. By replacing the median of the pixel values around each pixel, the random noise in the image is reduced and the visual effect of the image is improved. Median filtering is a nonlinear image processing technology that maintains the clarity of the image edge while denoising. This is especially important for image analysis because the edge helps better feature extraction and image recognition. After median filtering, the image noise is significantly reduced and the image quality is improved overall, thus obtaining image data after median filtering.
[0068] S113: geometrically transform the image data after median filtering, including rotation at random angles and random scaling between 90% and 110%, using the formula:
[0069] and ;
[0070] Generate a preprocessed image dataset;
[0071] in, represents the random rotation angle, represents the original pixel coordinates, Represents the new pixel coordinates after rotation.
[0072] formula:
[0073] and ;
[0074] Detailed explanation of the formula and the process of formula calculation and derivation:
[0075] The geometric transformation of an image includes rotation and scaling, where the rotation angle is Set to 15 degrees to simulate the offset of the image during monitoring. The rotation formula uses trigonometric functions to calculate the current pixel position to ensure accurate correspondence of the image content during rotation. Set the original coordinates of a pixel to , the new coordinates after rotation It will be calculated by the formula:
[0076] ;
[0077] ;
[0078] ;
[0079] The results show that the original pixel moves to the upper right after rotation and deviates from the original position by about 22.47 units horizontally and 29.29 units vertically, indicating that the pixel position is correctly adjusted after the image is rotated, providing multi-angle visual information for image analysis and enhancing the adaptability and flexibility of image processing.
[0080] See also Figure 3 , the specific steps for obtaining the fused convolution feature set are:
[0081] S211: input the preprocessed image data set into the deep learning model, apply multiple 3×3 convolution kernels to each image, perform convolution operations to extract basic image features, and obtain a preliminary feature map;
[0082] The preprocessed image data is input into a multi-layer convolutional neural network. First, multiple 3×3 convolution operations are performed on the image. The local features of the image are extracted through small convolution kernels. The output of each convolution layer will be nonlinearly transformed through the ReLU activation function. The ReLU function is chosen because it can introduce nonlinear processing without changing the size of the feature map and avoid the problem of gradient disappearance. The feature map after convolution will enter the pooling layer. The pooling layer uses a 2×2 maximum pooling operation to reduce the feature dimension, which can reduce the number of parameters and the amount of calculation of the model while maintaining key features. In the pooling process, the maximum value pooling is selected because it can retain the most significant features. Finally, these feature maps are spliced in the depth direction to form a feature representation. This deep splicing ensures that the information from the differentiated convolution layer is effectively merged, thereby capturing richer image information.
[0083] S212: Applying the activation function ReLU to the preliminary feature map to enhance the nonlinear representation of the feature and eliminate negative values, thereby obtaining an activated feature map;
[0084] The preliminary feature map obtained by using the ReLU activation function increases the model's ability to process nonlinear data. The main advantage of the ReLU function is its linear response to positive values and zero response to negative values. This feature enables the network to maintain a sparse activation state during training, which helps to reduce overfitting and also improves the training speed of the network. The activated feature map includes useful information and edge details, which is critical for feature extraction. In addition, the simplicity of ReLU also means that the computational efficiency is very high and it is suitable for deep network structures.
[0085] S213: Based on the activated feature map, the activated feature map is sent to a maximum pooling layer of size 2x2 to reduce the spatial dimension of the feature map and obtain a pooled feature map;
[0086] A 2×2 maximum pooling operation is performed on the ReLU activated feature map. The key purpose is to reduce the spatial dimension of the data. By reducing the size of the feature map, the number of parameters and computational complexity of the layer are reduced. Maximum pooling is chosen because it can retain key features, including edges and textures, while reducing the amount of data. In this way, the network can pay more attention to important features that help with classification or other tasks, while ignoring non-critical background information. In addition, the pooling layer can also provide a certain degree of translation invariance, which is a key attribute for image processing tasks.
[0087] S214: Concatenate the pooled feature maps in the depth direction using the formula:
[0088] ;
[0089] Generate a fused convolution feature set;
[0090] in, Represents the weight of the feature map of the i-th layer, and adjusts the contribution of the optimized feature. Represents the feature map after multi-layer pooling, is the fused feature set.
[0091] formula:
[0092] ;
[0093] Detailed explanation of the formula and the process of formula calculation and derivation:
[0094] In the formula, Represents the fused convolutional feature set, which is a feature map after multiple layers of pooling are spliced in the depth direction The feature map of each layer is obtained by coefficient Weighted to optimize its contribution in the fusion feature set, there are three layers of feature maps, the size of each layer of feature maps is 10x10, and the weight , , then the calculation is as follows:
[0095] ;
[0096] set up The elements in are A 10x10 matrix, then:
[0097] ;
[0098] This shows that the fused feature set The value at each position is obtained by weighted summing up the feature maps of the three differentiation layers. This weighted synthesis can adjust the influence of each layer according to task requirements, ensuring that the model captures abstract features from shallow to deep differentiation levels, providing a rich information basis for image recognition tasks.
[0099] See also Figure 4 , the steps for obtaining the feature representation after recursive processing are as follows:
[0100] S311: Serialize the fused convolution feature set, adjust the data format to match the input structure of the recursive neural network, and generate serialized feature data;
[0101] The convolutional feature set after serialization fusion is adjusted to match the input structure of the recursive neural network. The adaptive adjustment includes ensuring the continuity and neatness of the feature data so that the network can process the input data seamlessly. The key to this step is to convert the size and depth of the multi-layer feature set to match the requirements of the network architecture and ensure that each input layer can receive data in the correct format. This requires monitoring the data width and height during the serialization process and adjusting the dimensions to meet the needs of subsequent layers. At the same time, the adjusted data must be able to maintain the spatial and channel relationships of the original features to ensure the effectiveness of network training and the accuracy of feature extraction, and generate serialized feature data.
[0102] S312: Send the serialized feature data to the recursive neural network layer by layer, perform weighted sum calculation on each layer, combine the input feature with the previous hidden state, update it to the feature state of the current layer, and obtain the temporary feature state of each layer;
[0103] The serialized feature data is sent to the recursive neural network layer by layer, and each layer is weighted and calculated, combining the input features with the previous hidden state. In this process, the key is to determine the parameter W, which is obtained through previous training and represents the connection weight between features. The input features and hidden states are combined through matrix multiplication to generate the current hidden state. The core of this step is to effectively transmit the information of the previous state and fuse it with the current input, update it to the feature state of the current layer, and obtain the temporary feature state of each layer. This calculation process involves not only forward propagation, but also refers to the back propagation of the gradient to optimize the weight matrix W to ensure the accuracy of model training and the convergence of the network.
[0104] S313: Combine the temporary feature state and hidden state of the current layer, use the gating mechanism to update the hidden state, perform the gated update of the weighted sum, and use the formula:
[0105] ;
[0106] Generate the adjusted hidden state at each time step;
[0107] in, is the gating coefficient, is the weight matrix, is the activation function, , , and Respectively represent the hidden state of the current time step, the previous time step, the current input feature and the bias term;
[0108] formula:
[0109] ;
[0110] Detailed explanation of the formula and the process of formula calculation and derivation:
[0111] In a recurrent neural network, the hidden state at the current time step is From the previous state With the current input The weighted sum of After processing, we get is the weight matrix, is the bias term, is the gating coefficient, which adjusts the degree of fusion between the input and the previous state information. , is the sigmoid function, is [0.5,-0.2], , the previous state , current input ,but:
[0112] Compute the weighted sum:
[0113] ;
[0114] Add a bias and apply an activation function:
[0115] ;
[0116] The result is approximately ;
[0117] Apply the gating factor:
[0118] ;
[0119] Therefore, the hidden state at the current time step is for ,The results show that the current hidden state has achieved a balance between retaining past information and accepting new information. For this step, the results mean that the information flow can be effectively controlled and the memory capacity of the network can be optimized.
[0120] S314: Collect and combine the hidden states of all time steps to form a continuous temporal feature representation, and generate a recursively processed feature representation.
[0121] Collect and combine the hidden states of all time steps to form a continuous temporal feature representation. The key operation in this step is the accumulation and integration of hidden states. By traversing the time steps, the output states of each time step are arranged in order to ensure that the time dependency of the features is reflected. This process requires not only a state collection mechanism, but also data alignment to ensure that subsequent processing steps including classification or prediction can accurately interpret these features. The integrated data format must meet the input requirements of the subsequent processing modules to ensure the continuity and integrity of the data and generate a recursively processed feature representation.
[0122] See also Figure 5 , the specific steps for obtaining the antibody drug residue test results are:
[0123] S411: applying a corresponding weight to each hidden state in the feature representation after recursive processing, calculating a weighted value of each hidden state by matrix multiplication, performing a product operation based on the vector of the hidden state and the weight matrix, obtaining a weighted feature representation, and generating an intermediate feature vector;
[0124] Apply the corresponding weight to each hidden state in the feature representation after recursive processing. First, extract and separate each hidden state to ensure that the feature dimension of each hidden state remains unchanged. Then, perform matrix operations on each hidden state and the corresponding weight according to the collected weight matrix. Weighted processing is performed on multiple elements in the hidden state and the weight by matrix multiplication. The weighted features are accumulated to form the intermediate state of the feature representation. In the weighting process, it is necessary to call multiple parameters in the hidden state matrix and the weight matrix in turn. The selection of parameters is based on the feature data collected in the early stage. All weights are obtained through the target weight adjustment mechanism. The weight data is corrected and adjusted by analyzing the weights of the feature output of each layer after recursive processing. Finally, the results of weighted and processed all hidden states are accumulated to generate an intermediate feature vector.
[0125] S412: Perform a weighted sum operation on the intermediate feature vectors using the formula:
[0126] ;
[0127] Generate global feature vector;
[0128] in, is the global eigenvector, is the weight of the i-th hidden state, is the i-th hidden state, and To adjust the parameters affected by weights;
[0129] formula:
[0130] ;
[0131] The benefit of the formula is that it involves weights, hidden states, and adjustment parameters in the calculation, improves the stability and accuracy of the results through absolute value and square root operations, and avoids the influence of excessively large or small values on the global eigenvector.
[0132] Detailed explanation of the formula and the process of formula calculation and derivation:
[0133] set up , that is, there are 5 hidden states, and the collected weights are , and the hidden states are , adjust the parameters .
[0134] First calculate the weighted sum:
[0135] ;
[0136] Then substitute the adjustment parameters and calculate:
[0137] ;
[0138] The results show that the calculated value of the global eigenvector is 1.67, which is used as the input basis for classification.
[0139] S413: inputting the global feature vector into the classification layer, calculating the score of each category based on the linear transformation, performing the score comparison operation, calculating the belonging probability of multiple categories, and generating the score vector of each category;
[0140] The global feature vector is input into the classification layer. First, multiple data in the global feature vector are normalized to ensure that the value of each feature is distributed in the same range to avoid the influence of too large or too small values on the classification score. The normalization method is to standardize the difference between the maximum and minimum values in the global feature vector. Then, the standardized feature vector is input into multiple nodes of the classification layer one by one. The input features are weighted and processed in each node. Through the weighted and operation in the node, the corresponding parameters are calculated with the weight matrix of the classification layer to obtain the preliminary score of each category. Finally, the scores of multiple categories are output in sequence to generate a score vector for each category.
[0141] S414: Compare the size of the score vector of each category, determine the residue category to which the image belongs through the maximum score, and obtain the antibody drug residue detection result.
[0142] Compare the scores of each category. First, sort the multiple score items in the score vector of each category according to their numerical values. Recursively compare the score values to determine the item with the largest score value, and mark the index value of the corresponding category. Then call the index value to match the preset category label to determine the residue category to which the image belongs. Finally, output the matched residue category as the detection result to obtain the antibody drug residue detection result.
[0143] An antibody drug residue detection system based on image recognition, the antibody drug residue detection system based on image recognition is used to perform the above-mentioned antibody drug residue detection method based on image recognition, the system comprises:
[0144] The image preprocessing module collects the image data of antibody drug residues, linearly scales each pixel value to the range of 0 to 1, performs median filtering, selects the median of adjacent pixels to replace the current pixel value, and then performs a 15-degree random rotation and a 90% to 110% random scaling on the image to generate a preprocessed image data set;
[0145] The feature extraction module takes the preprocessed image dataset as input, processes the image layer by layer through multiple 3x3 convolution kernels, activates the output feature map of each layer using the ReLU function, performs a 2x2 maximum pooling operation after each convolution operation, concatenates all feature maps in the depth direction, and obtains the fused convolution feature set;
[0146] The feature serialization module serializes the fused convolution feature set and inputs it into the recursive neural network to process the feature map layer by layer. It updates the current state by weighted sum calculation with the previous hidden state using the gating mechanism, records the hidden state of each time step, and forms the feature representation after recursive processing.
[0147] The feature synthesis module applies the corresponding weight to each hidden state in the recursively processed feature representation for weighted sum calculation and converts it into a global feature vector;
[0148] The classification decision module inputs the global feature vector into the classification layer, calculates the score of each category, compares the scores to determine the residue category to which the image belongs, and obtains the antibody drug residue detection result.
[0149] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for detecting antibody drug residues based on image recognition, characterized in that: The following steps are involved: Based on the collected antibody drug residue image data, each pixel value of the image is linearly scaled to a range of 0 to 1, a median filter is applied to each pixel, the current pixel value is replaced by the median of the adjacent pixels, and then a 15-degree random rotation and a 90% to 110% random scaling are applied to the image to obtain a preprocessed image data set; Based on the preprocessed image data set, the image is passed through multiple convolution layers in sequence, a 3×3 convolution kernel is used in each layer to extract image features, a ReLU function is used to activate the feature map, a 2×2 maximum pooling operation is performed after each convolution to reduce the feature dimension, and all the obtained feature maps are spliced in the depth direction to form a fused convolution feature set; After serializing the fused convolutional feature set, the fused convolutional feature set is input into the recursive neural network layer by layer. The feature map of each layer is updated by calculating the weighted sum with the previous hidden state, using the gating mechanism to record the hidden state of each time step, and obtaining the feature representation after recursive processing. Applying corresponding weights to each hidden state in the feature representation after the recursive processing to perform weighted sum calculation to form a global feature vector, inputting the global feature vector into the classification layer, calculating the score of each category, determining the residue category to which the image belongs by the size of the score, and obtaining the antibody drug residue detection result; The steps for obtaining the antibody drug residue test results are specifically as follows: Applying a corresponding weight to each hidden state in the recursively processed feature representation, calculating a weighted value of each hidden state by matrix multiplication, performing a product operation based on a vector of the hidden state and the weight matrix to obtain a weighted feature representation, and generating an intermediate feature vector; A weighted sum operation is performed on the intermediate feature vectors using the formula: ; Generate global feature vector; in, is the global eigenvector, is the weight of the i-th hidden state, is the i-th hidden state, and To adjust the parameters affected by weights; Inputting the global feature vector into the classification layer, calculating the score of each category based on linear transformation, performing score comparison operation, calculating the belonging probability of multiple categories, and generating a score vector for each category; The score vector sizes of each category are compared, and the residue category to which the image belongs is determined by the maximum score to obtain the antibody drug residue detection result.
2. The method for detecting antibody drug residues based on image recognition according to claim 1, characterized in that: The steps of obtaining the preprocessed image data set are specifically as follows: Collect antibody drug residue image data, adjust each pixel value in the image to between 0 and 1 through a linear transformation algorithm to normalize the data range, and generate normalized image data; Applying median filtering to the normalized image data, replacing the image data with the median of the pixel values around each pixel to reduce image noise, and obtaining image data after median filtering; The image data after the median filtering is geometrically transformed, including a rotation at a random angle and a random scaling between 90% and 110%, using the formula: and ; Generate a preprocessed image dataset; in, represents the random rotation angle, represents the original pixel coordinates, Represents the new pixel coordinates after rotation.
3. The method for detecting antibody drug residues based on image recognition according to claim 2, characterized in that: The steps for obtaining the fused convolution feature set are specifically as follows: Input the preprocessed image data set into the deep learning model, apply multiple 3x3 convolution kernels to each image, perform convolution operations to extract basic image features, and obtain a preliminary feature map; Applying an activation function ReLU to the preliminary feature map to enhance the nonlinear representation of features and eliminate negative values, thereby obtaining an activated feature map; Based on the activated feature map, the activated feature map is sent to a maximum pooling layer of size 2x2 to reduce the spatial dimension of the feature map and obtain a pooled feature map; The pooled feature maps are concatenated in the depth direction using the formula: ; Generate a fused convolution feature set; in, Represents the weight of the feature map of the i-th layer, and adjusts the contribution of the optimized feature. Represents the feature map after multi-layer pooling, is the fused feature set.
4. The method for detecting antibody drug residues based on image recognition according to claim 3, characterized in that: The steps of obtaining the feature representation after the recursive processing are specifically as follows: Serializing the fused convolution feature set, adjusting the data format to match the input structure of the recursive neural network, and generating serialized feature data; The serialized feature data is fed into a recursive neural network layer by layer, and each layer performs a weighted sum calculation, combines the input feature with the previous hidden state, updates it to the feature state of the current layer, and obtains a temporary feature state of each layer; Combine the temporary feature state and hidden state of the current layer, use the gating mechanism to update the hidden state, perform the gated update of the weighted sum, and use the formula: ; Generate the adjusted hidden state at each time step; in, is the gating coefficient, is the weight matrix, is the activation function, , , and Respectively represent the hidden state of the current time step, the previous time step, the current input feature and the bias term; The hidden states of all the time steps are collected and combined to form a continuous temporal feature representation, generating a complete feature representation after recursive processing.
5. An antibody drug residue detection system based on image recognition, characterized in that: According to any one of claims 1 to 4, the method for detecting antibody drug residues based on image recognition comprises: The image preprocessing module collects the image data of antibody drug residues, linearly scales each pixel value to the range of 0 to 1, performs median filtering, selects the median of adjacent pixels to replace the current pixel value, and then performs a 15-degree random rotation and a 90% to 110% random scaling on the image to generate a preprocessed image data set; The feature extraction module takes the preprocessed image data set as input, processes the image layer by layer through multiple 3x3 convolution kernels, activates the output feature map of each layer using the ReLU function, performs a 2x2 maximum pooling operation after each convolution operation, splices all feature maps in the depth direction, and obtains a fused convolution feature set; The feature serialization module serializes the fused convolution feature set and inputs it into the recursive neural network, processes the feature map layer by layer, updates the current state by weighted sum calculation with the previous hidden state, records the hidden state of each time step, and forms a feature representation after recursive processing; The feature synthesis module applies corresponding weights to each hidden state in the feature representation after the recursive processing to perform weighted sum calculation and convert it into a global feature vector; The classification decision module inputs the global feature vector into the classification layer, calculates the score of each category, compares the scores to determine the residue category to which the image belongs, and obtains the antibody drug residue detection result.
Citation Information
Patent Citations
Analysis method for simultaneously detecting multiple drugs in water
CN118150749A
Crop disease and pest image recognition method and system based on deep learning
CN118262149A
Antimicrobic susceptibility testing using recurrent neural networks
US20230416801A1