Continuous optimization method and system for pH test paper image classification model based on user feedback

By using user feedback data-driven model retraining and optimization of the spectral attention module, the performance degradation of pH test strips in real-world environments was resolved, enabling continuous model optimization and efficient iteration, and improving interpretation accuracy and robustness.

CN121937804AInactive Publication Date: 2026-04-28SHANGHAI NINTH PEOPLES HOSPITAL SHANGHAI JIAO TONG UNIV SCHOOL OF MEDICINE
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI NINTH PEOPLES HOSPITAL SHANGHAI JIAO TONG UNIV SCHOOL OF MEDICINE
Filing Date
2026-03-30
Publication Date
2026-04-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies cannot effectively address the performance degradation of pH test strips in real-world environments caused by changes in lighting, equipment differences, and color noise. In particular, the recognition accuracy is insufficient in areas where pH color interpretation is ambiguous and when new color variations appear. Furthermore, the iteration cost is high, making continuous optimization difficult.

Method used

User feedback data is received through a front-end interactive application, structured and saved to a cloud sample database, and combined with a spectral attention module and a two-stage fine-tuning strategy to generate an enhanced training set for retraining the model, thereby achieving continuous model optimization.

Benefits of technology

It improves the robustness and accuracy of the model in real-world environments, has a high degree of automation, can respond to environmental changes in a timely manner, reduces iteration costs, and enhances the feature learning targeting and generalization ability for color-sensitive classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937804A_ABST
    Figure CN121937804A_ABST
Patent Text Reader

Abstract

The invention relates to a continuous optimization method and system for a pH test paper image classification model based on user feedback, and the method comprises the steps: receiving a to-be-tested pH test paper image, calling a pH test paper image classification model of a current version, and carrying out the classification of the to-be-tested pH test paper image, thereby obtaining a prediction result; collecting correctness feedback data of the user on the prediction result, and storing the correctness feedback data in a cloud sample database in a structured manner; merging the cloud sample database and the original training data set under a preset triggering condition, and performing preprocessing to generate an enhanced training set; retraining the pH test paper image classification model of the current version to generate a new version model with enhanced performance; and replacing the current version of the pH test paper image classification model with a new version of the model, and starting a new round of user interaction and image classification to realize continuous optimization of the pH test paper image classification model. Compared with the prior art, the method has the advantages that the continuous optimization of the model is realized, and the robustness of the model on pH test paper image classification in a real environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for continuous optimization of a pH test strip image classification model based on user feedback. Background Technology

[0002] In the field of artificial intelligence, deep learning models, especially convolutional neural networks (CNNs), have achieved great success in image classification tasks. However, a common technical challenge is domain bias, where high-performance models trained in controlled laboratory environments (e.g., using standard, well-defined datasets) often experience a significant performance drop once deployed to complex real-world environments. This performance degradation can be caused by factors including, but not limited to, differences in end-user devices, the variability of lighting conditions in the real world, the uncertainty of shooting angles, and image noise. For example, patent application CN108614858A discloses an image classification model optimization method, apparatus, and terminal. This method periodically trains a first image classification model using noisy data from a noise database, corrects it based on initial training data, and then uses the corrected second image classification model to filter noise data from the noise database and user-generated noise data within a preset time period. The filtered noise data is then merged and used to replace all data in the noise database, thereby optimizing the first image classification model. However, this method can only periodically process accumulated noise data in batches and cannot respond in real-time to rapid changes in lighting conditions, actively mine blurred boundary samples of critical colors, or incrementally learn for newly emerging color variations.

[0003] The interpretation of pH test strip colors is highly dependent on color accuracy. However, the variability of real-world usage environments (such as lighting and imaging equipment) differs significantly from standard laboratory conditions, making the shortcomings of existing technologies even more pronounced in this scenario. These shortcomings mainly include the following: 1) The color of pH test strips can appear visually different due to variations in the color temperature of ambient light (such as natural light, incandescent light, and fluorescent light). The long feedback cycle of current technology means that when the model misjudges a situation due to specific outdoor lighting conditions in spring, it may not be until summer that enough data can be collected to update the model, making it impossible to respond promptly to seasonal changes in lighting or sudden large-scale misjudgments by users.

[0004] 2) Interpreting the critical colors of pH test strips (such as the color transition between pH 6 and 7) is inherently difficult. Existing methods cannot systematically collect user feedback in these "grey areas".

[0005] 3) pH test strip classification is essentially a fine-grained identification of color spectra. Each full retraining cycle includes a large number of already learned, simple samples, failing to concentrate resources on efficiently learning from newly emerging color variations (such as test strip dampness or background interference). The high cost discourages developers from frequent iterations, preventing the model from continuously improving its color perception.

[0006] Therefore, there is an urgent need in this field for a method that can automatically and efficiently utilize real-world user feedback to continuously iterate and optimize deployed pH test strip image classification models. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the prior art by providing a method and system for continuous optimization of a pH test strip image classification model based on user feedback, thereby achieving continuous optimization of the model and improving its robustness in classifying pH test strip images in real-world environments.

[0008] The objective of this invention can be achieved through the following technical solutions: A method for continuous optimization of a pH test strip image classification model based on user feedback includes the following steps: The system receives images of pH test strips uploaded by users through a front-end interactive application, and calls the current version of the pH test strip image classification model to classify the images and obtain prediction results. Collect user feedback data on the correctness of the prediction results, and save the correctness feedback data in a structured manner to the cloud sample database; Under preset triggering conditions, the cloud sample database is merged with the original training dataset, and an enhanced training set is generated after preprocessing. The current version of the pH test strip image classification model is retrained based on the enhanced training set, the model parameters are updated, and a new version of the model with enhanced performance is generated. The current version of the pH test strip image classification model called by the front-end interactive application is replaced with the new version model, starting a new round of user interaction and image classification, thereby achieving continuous optimization of the pH test strip image classification model.

[0009] Furthermore, the user feedback data on the correctness of the prediction results includes two types of feedback data: user feedback indicating that the prediction was correct and user feedback indicating that the prediction was incorrect. User feedback data that indicates the prediction is correct is saved to the correct subdirectory of the cloud sample database according to a preset file name format; Feedback data indicating prediction errors from users is saved to the "incorrect" subdirectory of the cloud sample database according to a preset filename format.

[0010] Furthermore, the specific steps for saving user feedback data indicating correct predictions to the "correct" subdirectory of the cloud sample database according to a preset filename format include: When the user provides feedback on the correctness of the prediction result, the image of the pH test strip uploaded by the user is saved in the correct subdirectory of the cloud sample database with a preset filename format that includes the original prediction label of the model and the timestamp. The specific steps for saving user feedback data indicating prediction errors to the incorrect subdirectory of the cloud sample database according to a preset filename format include: When the user provides feedback on the correctness of the prediction result, indicating a prediction error, the correct label selected by the user from the preset pH value category list based on the prediction result is collected. The user-uploaded pH test strip image and correct label are treated as error data pairs and saved in the incorrect subdirectory of the cloud sample database with a preset filename format containing the correct label, the model's original prediction label, and a timestamp.

[0011] Furthermore, the preset triggering conditions include time period triggering and error data pair quantity threshold triggering.

[0012] Furthermore, the specific steps for merging the cloud-based sample database with the original training dataset and generating an enhanced training set through preprocessing include: Collect the image paths and their corresponding correct labels for all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory; The image paths of all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory, along with their corresponding correct labels and incorrect data pairs, are merged to obtain the initial merged training set; The initial merged training set is preprocessed to generate an enhanced training set. The preprocessing includes color enhancement, geometric transformation, and normalization.

[0013] Furthermore, the pH test strip image classification model includes a feature extraction backbone network, an attention module, and a classification head network layer connected in sequence. The feature extraction backbone network adopts a pre-trained convolutional neural network to extract multi-level visual feature representations from the pH test strip image to be tested. The attention module adopts a spectral attention module to perform channel weighting on the feature map and enhance the feature weights related to color sensitivity. The classification head network layer is used to map the weighted features to a preset pH value category and output a classification probability distribution.

[0014] Furthermore, when retraining the current version of the image classification model using the enhanced training set, a two-stage fine-tuning strategy is employed, specifically including the following steps: In the first warm-up training phase, all parameters of the feature extraction backbone network are frozen, and only the attention module and the classification head network layer are trained. In the second fine-tuning training phase, all parameters of the feature extraction backbone network are unfrozen, and the current version of the image classification model is fine-tuned end-to-end using a learning rate lower than that in the first warm-up training phase.

[0015] Furthermore, the objective function for the first warm-up training phase is: In the formula, The objective function for the first warm-up training phase is... For model parameters, The total number of samples in the enhanced training set. For the first Image of the pH test strip to be tested. For the first The true pH value category label vector of the pH test strip image to be tested. For the enhanced training set, These are the weighting coefficients for the cross-entropy loss term. Let cross-entropy be the loss function. This is the overall prediction function for the pH test strip image classification model. These are the weighting coefficients for the spectral regularization term. For spectral attention regularization, These are the trainable parameters for the attention module. Preset the total number of categories for pH value. For the first The true pH value category label vector of the pH test strip image to be tested is in the first... The components of the preset pH value category, For the first The image of the pH test strip to be tested belongs to the first... Confidence level of preset pH value categories, This is the function representation of the attention module. This is a functional representation of the feature extraction backbone network. This represents the ideal spectral eigenvector.

[0016] Furthermore, the optimization objective function for the second fine-tuning training phase is: In the formula, The objective function for the second fine-tuning training phase is... The regularization coefficient is . For color consistency regularization, These are attention parameters after the first warm-up training phase. These are the weighting coefficients. For indicator functions, For the first pH preset categories, For the first The mean predicted probability of each pH value preset category.

[0017] According to another aspect of the present invention, a continuous optimization method system for a pH test strip image classification model based on user feedback is provided, comprising: The pH prediction module is used to receive images of pH test strips uploaded by users through a front-end interactive application, and to call the current version of the pH test strip image classification model to classify the images of pH test strips and obtain prediction results. The prediction feedback module is used to collect user feedback data on the correctness of the prediction results and to save the correctness feedback data in a structured way to the cloud sample database. The training set enhancement module, under preset triggering conditions, merges the cloud sample database with the original training dataset and generates an enhanced training set after preprocessing. The model retraining module is used to retrain the current version of the pH test strip image classification model based on the enhanced training set, update the model parameters, and generate a new version of the model with enhanced performance. The model continuous optimization module is used to replace the current version of the pH test strip image classification model called by the front-end interactive application with the new version model, start a new round of user interaction and image classification, and realize the continuous optimization of the pH test strip image classification model.

[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention automatically triggers the retraining process by setting a preset time period and a threshold for the number of error data pairs. It combines the user-reported erroneous prediction samples with the correct labels into the original training set to generate an enhanced training set. This enhances the training set for the pH test strip image classification model. This overcomes the limitations of existing technologies that rely on manual intervention to collect feedback, have cumbersome processes, and have long iteration cycles. It also solves the problem of the inability to adapt and optimize in a timely manner when the model's performance deteriorates due to environmental changes after deployment. This improves the automation level, iteration efficiency, and robustness of the model in real-world environments.

[0019] 2. This invention overcomes the limitations of existing technologies, such as high computational cost of full retraining and difficulty in specifically learning critical colors or variant samples, by structuring and saving user feedback data to a cloud sample database and integrating a spectral attention module with a two-stage fine-tuning strategy including a color consistency regularization term during retraining. It also solves the problem of insufficient recognition accuracy of the model in the ambiguous zone of pH value color interpretation and when dealing with newly emerging color variations, thereby improving the feature learning specificity, interpretation accuracy and generalization ability of the model in color-sensitive classification tasks. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the continuous optimization method for a pH test strip image classification model based on user feedback proposed in this invention. Figure 2 This is a schematic diagram of the interaction process of a front-end interactive application. Detailed Implementation

[0021] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0022] The following English abbreviations are involved: Point-of-Care Testing (POCT) Example 1 This embodiment provides a method for continuous optimization of a pH test strip image classification model based on user feedback, such as... Figure 1 As shown, it includes the following steps: S1. Receive the pH test strip image uploaded by the user through the front-end interactive application, and call the current version of the pH test strip image classification model to classify the pH test strip image and obtain the prediction result.

[0023] In this embodiment, the front-end interactive application is a web application deployed on the user's terminal, built using the Grado framework, providing the user with an intuitive interactive interface. The specific interaction steps are as follows: Figure 2 As shown. The core functionalities of a front-end interactive application include: Image upload interface: Provides an input component that allows users to take photos with their mobile phones or select images of pH test strips from their local photo albums.

[0024] Results Display Interface: After the user clicks "Start Recognition", the current version of the pH test strip image classification model deployed in the cloud is called to perform inference, and the prediction results and corresponding confidence scores are presented to the user in a visual way.

[0025] Feedback Collection Interface: Below the results display, a set of feedback components is provided, including: a "Prediction Correct" button, a "Prediction Incorrect" button, and a "Submit Feedback" button. When the user clicks this button, a drop-down menu dynamically appears, containing all possible correct pH value preset categories (e.g., 5, 6, 7, 8, 9) for the user to select. The "Submit Feedback" button is used to confirm and submit feedback on the accuracy of the prediction.

[0026] S2. Collect user feedback data on the correctness of the prediction results and save the correctness feedback data in a structured way to the cloud sample database.

[0027] User feedback data on the accuracy of the prediction results includes two types of feedback data: user feedback that the prediction was correct and user feedback that the prediction was incorrect.

[0028] User feedback data indicating correct predictions is saved to the "correct" subdirectory of the cloud sample database according to a preset filename format. Specific steps include: When the user provides feedback that the prediction is correct, the image of the pH test strip uploaded by the user is saved in a preset filename format that includes the model's original prediction label and timestamp to the correct subdirectory of the cloud sample database.

[0029] User feedback indicating prediction errors is saved to the "incorrect" subdirectory of the cloud sample database according to a preset filename format. Specific steps include: When the user's feedback data on the correctness of the prediction result is a prediction error, the correct label selected by the user from the preset pH value category list based on the prediction result is collected. The user-uploaded pH test strip image and correct label are treated as error data pairs and saved in the incorrect subdirectory of the cloud sample database with a preset filename format containing the correct label, the model's original predicted label, and a timestamp.

[0030] S3. Under preset trigger conditions, merge the cloud sample database with the original training dataset, and generate an enhanced training set after preprocessing.

[0031] The preset triggering conditions include time period triggering and error data pair quantity threshold triggering.

[0032] The time-cycle trigger can be set to automatically start retraining once a week, once a month, or once a day. This periodic trigger ensures that the model is updated regularly and avoids long-term stagnation.

[0033] The error sample count threshold trigger is set to automatically trigger retraining when the number of newly added error data pairs in the cloud sample database reaches a preset threshold. This condition ensures that the model can learn from accumulated errors in a timely manner, which is especially suitable for high-frequency use cases. The threshold setting needs to balance the sufficiency of data and computational cost, and is usually determined based on historical data statistics.

[0034] When the triggering condition is met, the system automatically executes the following steps: The sample database is continuously monitored for changes in data volume or time points through cloud-based backend services to perform conditional detection.

[0035] Once the conditions are met, the data is merged to generate an enhanced training set, and a two-stage fine-tuning training is initiated.

[0036] The triggering conditions are designed with computational resources optimized. Threshold triggering avoids frequent retraining, while time-period triggering facilitates planned operations and reduces peak load.

[0037] By replacing manual intervention with preset conditions, the model iteration cycle is shortened from several weeks to several days, significantly improving efficiency.

[0038] The triggering conditions in this embodiment can be adjusted according to the application scenario. For example, in medical point-of-care testing (POCT), if the number of erroneous samples increases rapidly, threshold triggering can respond quickly; while in a stable environment, time-period triggering can ensure regular updates.

[0039] The retraining trigger condition is essential for continuous optimization, and its design balances automation, resource efficiency, and scenario adaptability. Through flexible configuration of the time period and error sample threshold, the system can intelligently determine the timing of iterations in the real world, improving the model's robustness and usability.

[0040] The specific steps for merging the cloud-based sample database with the original training dataset and generating an enhanced training set through preprocessing include: Collect the image paths and their corresponding correct labels for all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory; The image paths of all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory, along with their corresponding correct labels and incorrect data pairs, are merged to obtain the initial merged training set; The initial merged training set is preprocessed to generate an enhanced training set. The preprocessing includes color enhancement, geometric transformation, and normalization.

[0041] S4. Retrain the current version of the pH test strip image classification model based on the enhanced training set, update the model parameters, and generate a new version of the model with enhanced performance.

[0042] The pH test strip image classification model consists of a feature extraction backbone network, an attention module, and a classification head network layer connected in sequence. The feature extraction backbone network uses a pre-trained convolutional neural network to extract multi-level visual feature representations from the pH test strip image. The attention module uses a spectral attention module to perform channel weighting on the feature map and enhance the feature weights related to color sensitivity. The classification head network layer is used to map the weighted features to the preset pH value category and output the classification probability distribution.

[0043] When retraining the current version of the image classification model using an enhanced training set, a two-stage fine-tuning strategy is employed, with the following steps: In the first warm-up training phase, all parameters of the feature extraction backbone network are frozen, and only the attention module and the classification head network layer are trained. The optimization objective function for the first warm-up training phase is: In the formula, The objective function for the first warm-up training phase is... For model parameters, The total number of samples in the enhanced training set. For the first Image of the pH test strip to be tested. For the first The true pH value category label vector of the pH test strip image to be tested. For the enhanced training set, These are the weighting coefficients for the cross-entropy loss term. Let cross-entropy be the loss function. This is the overall prediction function for the pH test strip image classification model. These are the weighting coefficients for the spectral regularization term. For spectral attention regularization, These are the trainable parameters for the attention module. Preset the total number of categories for pH value. For the first The true pH value category label vector of the pH test strip image to be tested is in the first... The components of the preset pH value category, For the first The image of the pH test strip to be tested belongs to the first... Confidence level of preset pH value categories, This is the function representation of the attention module. This is a functional representation of the feature extraction backbone network. This represents the ideal spectral eigenvector.

[0044] In the second fine-tuning training phase, all parameters of the backbone network are unfrozen and fine-tuned end-to-end using a learning rate lower than that of the first warm-up training phase. The optimization objective function for the second fine-tuning training phase is: In the formula, The objective function for the second fine-tuning training phase is... The regularization coefficient is . For color consistency regularization, These are attention parameters after the first warm-up training phase. These are the weighting coefficients. For indicator functions, For the first pH preset categories, For the first The mean predicted probability of each pH value preset category.

[0045] S5. Replace the current version of the pH test strip image classification model called by the front-end interactive application with the new version model, start a new round of user interaction and image classification, and realize the continuous optimization of the pH test strip image classification model.

[0046] The new model begins processing real-world user requests. Because it's trained on an augmented training set that incorporates historical error samples and raw data, it theoretically has a stronger ability to recognize previously encountered challenging scenarios (such as images taken under specific lighting conditions or with specific devices). The front-end interactive application continues to provide prediction services to all users and collects user feedback using the exact same mechanism. At this point, users may encounter new error cases, which reveal cognitive blind spots in the model under the new data distribution. This newly collected feedback data is structured and stored in a cloud database. When the triggering conditions are met again, the system automatically initiates the next round of retraining. In this way, the model possesses the ability to continuously self-evolve, and its robustness and accuracy will continuously improve over time and with a larger user base.

[0047] Example 2 This embodiment provides a continuous optimization method system for a pH test strip image classification model based on user feedback, including: The pH prediction module is used to receive images of pH test strips uploaded by users through the front-end interactive application, and call the current version of the pH test strip image classification model to classify the images of pH test strips and obtain the prediction results. The prediction feedback module is used to collect user feedback data on the correctness of the prediction results and to save the correctness feedback data in a structured way to the cloud sample database. The training set enhancement module, under preset trigger conditions, merges the cloud sample database with the original training dataset and generates an enhanced training set after preprocessing. The model retraining module is used to retrain the current version of the pH test strip image classification model based on the enhanced training set, update the model parameters, and generate a new version of the model with enhanced performance. The model continuous optimization module is used to replace the current version of the pH test strip image classification model called by the front-end interactive application with the new version of the model, start a new round of user interaction and image classification, and realize the continuous optimization of the pH test strip image classification model.

[0048] The rest is the same as in Example 1.

[0049] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for continuous optimization of a pH test strip image classification model based on user feedback, characterized in that, Includes the following steps: The system receives images of pH test strips uploaded by users through a front-end interactive application, and calls the current version of the pH test strip image classification model to classify the images and obtain prediction results. Collect user feedback data on the correctness of the prediction results, and save the correctness feedback data in a structured manner to the cloud sample database; Under preset triggering conditions, the cloud sample database is merged with the original training dataset, and an enhanced training set is generated after preprocessing. The current version of the pH test strip image classification model is retrained based on the enhanced training set, the model parameters are updated, and a new version of the model with enhanced performance is generated. The current version of the pH test strip image classification model called by the front-end interactive application is replaced with the new version model, starting a new round of user interaction and image classification, thereby achieving continuous optimization of the pH test strip image classification model.

2. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 1, characterized in that, User feedback on the accuracy of the prediction results includes two types of feedback: user feedback indicating that the prediction was correct and user feedback indicating that the prediction was incorrect. User feedback data that indicates the prediction is correct is saved to the correct subdirectory of the cloud sample database according to a preset file name format; Feedback data indicating prediction errors from users is saved to the "incorrect" subdirectory of the cloud sample database according to a preset filename format.

3. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 2, characterized in that, The specific steps for saving user feedback data that indicates the prediction is correct to the "correct" subdirectory of the cloud sample database according to a preset filename format include: When the user provides feedback on the correctness of the prediction result, the image of the pH test strip uploaded by the user is saved in the correct subdirectory of the cloud sample database with a preset filename format that includes the original prediction label of the model and the timestamp. The specific steps for saving user feedback data indicating prediction errors to the incorrect subdirectory of the cloud sample database according to a preset filename format include: When the user provides feedback on the correctness of the prediction result, indicating a prediction error, the correct label selected by the user from the preset pH value category list based on the prediction result is collected. The user-uploaded pH test strip image and correct label are treated as error data pairs and saved in the incorrect subdirectory of the cloud sample database with a preset filename format containing the correct label, the model's original prediction label, and a timestamp.

4. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 3, characterized in that, The preset triggering conditions include time period triggering and error data pair quantity threshold triggering.

5. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 4, characterized in that, The specific steps for merging the cloud-based sample database with the original training dataset and generating an enhanced training set through preprocessing include: Collect the image paths and their corresponding correct labels for all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory; The image paths of all images in the original training dataset, the correct subdirectory, and the incorrect subdirectory, along with their corresponding correct labels and incorrect data pairs, are merged to obtain the initial merged training set; The initial merged training set is preprocessed to generate an enhanced training set. The preprocessing includes color enhancement, geometric transformation, and normalization.

6. The method for continuous optimization of the pH test strip image classification model based on user feedback according to claim 1, characterized in that, The pH test strip image classification model includes a feature extraction backbone network, an attention module, and a classification head network layer connected in sequence. The feature extraction backbone network uses a pre-trained convolutional neural network to extract multi-level visual feature representations from the pH test strip image to be tested. The attention module uses a spectral attention module to perform channel weighting on the feature map and enhance the feature weights related to color sensitivity. The classification head network layer is used to map the weighted features to a preset pH value category and output a classification probability distribution.

7. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 6, characterized in that, When retraining the current version of the image classification model using the enhanced training set, a two-stage fine-tuning strategy is employed, the specific steps of which include: In the first warm-up training phase, all parameters of the feature extraction backbone network are frozen, and only the attention module and the classification head network layer are trained. In the second fine-tuning training phase, all parameters of the feature extraction backbone network are unfrozen, and the current version of the image classification model is fine-tuned end-to-end using a learning rate lower than that in the first warm-up training phase.

8. The continuous optimization method for the pH test strip image classification model based on user feedback according to claim 7, characterized in that, The objective function for the first warm-up training phase is: In the formula, The objective function for the first warm-up training phase is... For model parameters, The total number of samples in the enhanced training set. For the first Image of the pH test strip to be tested. For the first The true pH value category label vector of the pH test strip image to be tested. For the enhanced training set, These are the weighting coefficients for the cross-entropy loss term. Let cross-entropy be the loss function. This is the overall prediction function for the pH test strip image classification model. These are the weighting coefficients for the spectral regularization term. For spectral attention regularization, These are the trainable parameters for the attention module. Preset the total number of categories for pH value. For the first The true pH value category label vector of the pH test strip image to be tested is in the first... The components of the preset pH value category, For the first The image of the pH test strip to be tested belongs to the first... Confidence level of preset pH value categories, This is the function representation of the attention module. This is a functional representation of the feature extraction backbone network. This represents the ideal spectral eigenvector.

9. The method for continuous optimization of the pH test strip image classification model based on user feedback according to claim 8, characterized in that, The optimization objective function for the second fine-tuning training phase is: In the formula, The objective function for the second fine-tuning training phase is... The regularization coefficient is . For color consistency regularization, These are attention parameters after the first warm-up training phase. These are the weighting coefficients. For indicator functions, For the first pH preset categories, For the first The mean predicted probability of each pH value preset category.

10. A continuous optimization method system for a pH test strip image classification model based on user feedback, characterized in that, include: The pH prediction module is used to receive images of pH test strips uploaded by users through a front-end interactive application, and to call the current version of the pH test strip image classification model to classify the images of pH test strips and obtain prediction results. The prediction feedback module is used to collect user feedback data on the correctness of the prediction results and to save the correctness feedback data in a structured way to the cloud sample database. The training set enhancement module, under preset triggering conditions, merges the cloud sample database with the original training dataset and generates an enhanced training set after preprocessing. The model retraining module is used to retrain the current version of the pH test strip image classification model based on the enhanced training set, update the model parameters, and generate a new version of the model with enhanced performance. The model continuous optimization module is used to replace the current version of the pH test strip image classification model called by the front-end interactive application with the new version model, start a new round of user interaction and image classification, and realize the continuous optimization of the pH test strip image classification model.

Citation Information

Patent Citations

  • Image classification model optimization method and apparatus, and terminal

    CN108614858A