A formaldehyde concentration detection method based on image recognition

CN122689770APending Publication Date: 2026-09-04SHANGHAI SHUREN BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610836138.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-10
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

酚试剂法因操作简便、显色稳定,成为甲醛检测的主流方法,传统检测依赖分光光度计获取吸光度数值,再通过标准曲线计算浓度,虽精度较高,但存在明显局限

Benefits of technology

1、本发明无需依赖分光光度计等大型实验室设备,仅通过标准化图像采集与AI模型即可完成检测,并且支持现场即时操作,从而大幅提升检测便携性与场景适配性,满足室内、车内等多场景快速检测需求,并且通过标准化显色、图像采集与AI校正流程,规避人工比色、操作手法、环境光照等干扰因素,模型以均方误差、平均绝对误差为核心指标优化,回归模型平均绝对误差≤0.3μg/mL,结合空白样误差修正与标准体积换算,确保检测结果符合国家甲醛检测标准,定量精度远高于肉眼比色。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122689770A_ABST
    Figure CN122689770A_ABST
Patent Text Reader

Abstract

The application discloses a formaldehyde concentration detection method based on image recognition and relates to the technical field of formaldehyde concentration detection.The method comprises the following steps: S1, standard solution color development: taking nine colorimetric tubes with consistent specifications, preparing different concentration standard formaldehyde solutions in each colorimetric tube, and adding a color developing solution to develop color. The formaldehyde concentration detection method based on image recognition does not need to rely on large laboratory equipment such as a spectrophotometer, but can complete detection only through standardized image acquisition and an AI model, supports on-site instant operation, greatly improves detection portability and scene adaptability, meets the requirements of rapid detection in multiple scenes such as indoor and in-vehicle scenes, and avoids interference factors such as manual colorimetry, operation methods and environmental illumination through a standardized color development, image acquisition and AI correction process, and the model is optimized with mean square error and mean absolute error as core indexes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of formaldehyde concentration detection technology, specifically to a formaldehyde concentration detection method based on image recognition. Background Technology

[0002] Formaldehyde is one of the main indoor air pollutants, and accurate detection of its concentration is crucial for the safety of human living environments. The phenol reagent method has become the mainstream method for formaldehyde detection due to its simple operation and stable color development. Traditional detection relies on spectrophotometers to obtain absorbance values ​​and then calculate the concentration through a standard curve. Although this method has high accuracy, it has obvious limitations.

[0003] First, existing formaldehyde detection methods are highly dependent on equipment. Spectrophotometers are large and require an external power supply, so they can only be used in the laboratory and cannot meet the needs of rapid on-site testing, limiting the flexibility of testing scenarios. Furthermore, the entire process of standard solution preparation, color development, and reading relies on manual labor, which is easily affected by factors such as operating techniques, ambient temperature, and light. Parallel samples have large deviations, and single sample testing is time-consuming and difficult to process in batches. Secondly, existing formaldehyde detection methods are highly subjective and have poor accuracy. Traditional colorimetric methods rely on visual comparison of color cards to determine concentration, which is affected by the observer's color vision and ambient light, resulting in significant errors and making it impossible to achieve accurate quantitative detection. Furthermore, the detection data needs to be manually recorded, organized, and converted, which is prone to recording errors. It also lacks an automated identification, correction, and data output system, making it unsuitable for digital detection needs. Summary of the Invention

[0004] The purpose of this invention is to provide a formaldehyde concentration detection method based on image recognition to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a formaldehyde concentration detection method based on image recognition, comprising the following steps: S1. Standard solution color development: Take 9 colorimetric tubes of the same specification and prepare formaldehyde standard color development solutions of different concentrations in each colorimetric tube; S2. Image Acquisition: Acquire standardized images of the colorimetric solution and screen the acquired images to eliminate interference factors such as lighting, angle, and background. It is necessary to ensure the correspondence between image features and formaldehyde concentration to provide high-quality samples for subsequent dataset construction and AI training. S3. Dataset Construction: Standardized images are preprocessed and labeled to construct training, validation, and test sets, ensuring the diversity and accuracy of the datasets and providing effective data support for AI model training. S4. Core Recognition Model Construction: Select an AI model suitable for image classification and regression, and build the model structure based on the deep learning framework. Set the input as the preprocessed color developing liquid image, and set the output as the formaldehyde concentration prediction value (continuous value) or concentration category (classification value). Set convolutional layer, pooling layer and fully connected layer in the middle layer to extract image color features and establish the mapping relationship between features and concentration. S5. Sample Collection: Guide customers to collect colorimetric images of samples to be tested according to standardized requirements, ensuring that the uploaded images meet the recognition requirements of the AI ​​model and reduce detection errors; S6, AI Correction: Eliminates image deviations caused by factors such as the customer's shooting environment and operational errors, corrects the uploaded images to be detected, ensures the accuracy of AI model recognition, and reduces system errors; S7. Output of Detection Results: Based on the AI-corrected image, the formaldehyde concentration of the sample to be tested is output through model prediction and concentration conversion, ensuring that the results are accurate, intuitive, and meet the testing standards. The specific operation process includes: S71. Model Prediction: Input the AI-corrected image to be detected into the deployed AI model. Based on the learned mapping relationship between concentration and image features, the model outputs a predicted formaldehyde concentration value (continuous value) or concentration category. S72. Concentration Conversion: If the model output is a concentration category, it is converted into a specific concentration value by combining the concentration range of the standard series (taking the median value of the category, or further refining it according to image features). If the model output is a continuous value, it is directly used as the preliminary concentration result. S73. Error Correction: By combining the image features of the blank sample, the concentration result of the sample to be tested is corrected to eliminate systematic errors caused by reagent blanks and environmental interference. S74. Result Judgment Output: Based on national formaldehyde testing standards, determine whether the test results are qualified (e.g., the indoor formaldehyde limit is 0.10 mg / m³). If air sampling testing is involved, the concentration of the colorimetric reagent needs to be converted to the formaldehyde concentration in the air. The conversion formula includes: Formula for converting sampling volume under standard conditions: ; in: Sampling volume under standard conditions; : Sampling volume; : Temperature at the sampling point; Absolute temperature under standard conditions; Atmospheric pressure at the sampling point; Atmospheric pressure under standard conditions; Calculation of formaldehyde concentration in the air: ; in: Formaldehyde concentration in the air; : Absorbance of the sample solution; : Absorbance of the blank solution; : Calculation factor; : Sampling volume under standard conditions.

[0006] Furthermore, step S1 includes the following sub-steps: S11. Preparation: Prepare the following solutions in advance: phenol reagent solution (concentration 0.1g / L, weigh 0.01g of phenol reagent, dilute to 100mL with distilled water, shake well and refrigerate, shelf life 7 days), ferric ammonium sulfate solution (concentration 10g / L, weigh 1g of ferric ammonium sulfate, dissolve in a small amount of distilled water, add 2 drops of concentrated sulfuric acid, dilute to 100mL, shake well and set aside), and formaldehyde standard stock solution (concentration 100μg / mL, commercially available standard or self-prepared, refrigerated). Then clean and disinfect the selected colorimetric tubes. S12. Preparation of standard series: Prepare formaldehyde standard solutions of different concentrations in the colorimetric tubes after cleaning and disinfection. Parallel samples should be set up for each group during preparation to avoid errors. S13. Colorimetric reaction: Add ferric ammonium sulfate solution to each colorimetric tube and gently invert and shake to mix (avoid vigorous shaking to prevent air bubbles). Then place the colorimetric tubes in a constant temperature environment of 25±2℃ and let them stand in the dark for 10-20 minutes to complete the colorimetric reaction (formaldehyde reacts with phenol reagent to form a azine, and the azine reacts with ferric ammonium sulfate to form a blue-green complex; the higher the concentration, the deeper the color). S14. Inspection and handling: Observe all colorimetric solutions to ensure that there is no turbidity, no precipitation, no bubbles, and the color is uniform. If any abnormality is found, the standard solution for that group must be prepared again to rule out problems such as reagent deterioration and operational errors.

[0007] Furthermore, the formaldehyde standard solution in step S12 is prepared from formaldehyde standard stock solution, phenol reagent solution and distilled water in different proportions, and must be thoroughly shaken during the preparation process.

[0008] Furthermore, in step S2, when acquiring images, a white LED surface light source (uniform brightness, no shadows, and illuminance controlled at 500±50 lux) should be used. The vertical distance between the light source and the colorimetric tube should be 30cm to avoid direct strong light or insufficient light. A pure white non-reflective background board (size not less than 20cm×20cm) should be used to ensure that the background is free of debris and color interference. In addition, the ambient temperature for taking pictures should be maintained at 25±2℃ to avoid the color shift of the colorimetric liquid caused by temperature changes.

[0009] Furthermore, when taking photos, a colorimeter holder must be used to fix the colorimeter tubes, and all colorimeter tubes must be placed at the same height (the tube opening is horizontal with the lens) and at the same angle (the lens is vertically aligned with the center of the colorimeter tube). The distance between the lens and the colorimeter tube must be fixed at 40cm. Moreover, when taking photos, each colorimeter tube must be photographed in sequence, with 3 photos taken for each parallel sample, and each image must be named separately.

[0010] Furthermore, step S3 includes the following sub-steps: S31. Image preprocessing: The qualified images after screening are uniformly processed to eliminate irrelevant interference and extract effective features; S32. Image annotation: Use annotation tools to accurately annotate the preprocessed image. The annotation content includes category annotation and color feature annotation. After the annotation is completed, the annotation verification must be performed to ensure that the annotation accuracy is 100%. If there is any inconsistency in the annotation, it must be re-checked and corrected. S33. Dataset Partitioning: The labeled images are divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used to train the AI ​​model, learning the correspondence between formaldehyde concentration and color rendering images. During training, a loss function is used to measure prediction bias. The core loss function (mean squared error, MSE) of the regression model is as follows: ; in: Number of training samples; : The actual formaldehyde concentration of the sample; Model predicts formaldehyde concentration; S34. Dataset saving: Save the divided dataset in a directory structure of training set, validation set, test set-concentration-image name, and save the annotation files at the same time for easy model calling and maintenance.

[0011] Furthermore, the preprocessing in step S31 includes cropping, noise reduction, and normalization. The cropping is performed using an image editing tool to crop the image to retain only the colorimetric liquid area in the colorimetric tube (removing irrelevant parts such as the tube wall, background, and scale), with a uniform cropping size of 500×500 pixels.

[0012] Furthermore, the denoising process employs a Gaussian filtering algorithm to remove minor noise (such as dust and light spots) from the image, maintaining the authenticity of the color of the developing solution without altering the color characteristics of the image. Normalization, on the other hand, normalizes the pixel values ​​of the image to the range of 0-255, unifying the image brightness and contrast to ensure consistency between images captured in different batches.

[0013] Furthermore, in step S4, the training parameters of the model need to be set, such as setting the initial learning rate to 0.001 and adopting an adaptive learning rate adjustment strategy. As the number of training rounds increases, the learning rate is gradually reduced to avoid model oscillation. The batch size is set to 16 or 32, which is adjusted according to the hardware configuration to ensure training efficiency and stability. The initial number of training rounds is set to 50 rounds. If the accuracy of the validation set no longer improves, training is stopped (early stop strategy) to avoid overfitting. The mean squared error (MSE) is used as the loss function (suitable for concentration regression) or the cross-entropy loss function (suitable for concentration classification) to measure the deviation between the model's predicted value and the actual concentration. After setting, the model training process is performed.

[0014] Furthermore, after the model is trained, its performance is evaluated using a test set. Key evaluation metrics include: Recognition accuracy: The mean absolute error of the regression model is ≤0.3μg / mL, calculated using the following formula: ; Generalization ability: Test the images of the color developing solution taken in different batches and under different environments to ensure that the model can still accurately identify under slight interference (such as light fluctuations, slight color deviation); Optimization and adjustment: If the model performance does not meet the requirements, adjust the training parameters, supplement the training data, or optimize the image preprocessing steps, and retrain until the detection requirements are met.

[0015] This invention provides a formaldehyde concentration detection method based on image recognition, which has the following beneficial effects: 1. This invention does not rely on large laboratory equipment such as spectrophotometers. It can complete the detection through standardized image acquisition and AI model, and supports on-site operation, thereby greatly improving the portability and adaptability of the detection. It meets the needs of rapid detection in multiple scenarios such as indoor and in-vehicle environments. Furthermore, through standardized color development, image acquisition and AI correction processes, it avoids interference factors such as manual colorimetry, operation methods and ambient lighting. The model is optimized with mean square error and mean absolute error as the core indicators. The mean absolute error of the regression model is ≤0.3μg / mL. Combined with blank sample error correction and standard volume conversion, it ensures that the detection results meet the national formaldehyde detection standards, and the quantitative accuracy is much higher than that of visual colorimetry.

[0016] 2. This invention automates the entire process from image preprocessing, model prediction, concentration conversion, to result determination, eliminating the need for manual calculations and data organization. It can process test samples in batches and employs early stopping strategies and adaptive learning rates to effectively shorten the model training cycle and improve detection response speed. Furthermore, by constructing standardized datasets and unified image acquisition specifications, it eliminates the need for professional testing personnel. Ordinary users can obtain accurate results simply by collecting sample images as required. The test results are displayed intuitively and automatically determine whether the results are qualified. Combined with the air sampling volume conversion formula, it directly outputs the formaldehyde concentration in the air, simplifying the testing process.

[0017] 3. This invention effectively eliminates interference from light fluctuations, slight color casts, dust, etc. through preprocessing such as Gaussian filtering for noise reduction and pixel normalization, as well as AI environment correction steps. Furthermore, the model is trained with multiple batches of data from various environments and can still stably recognize data under complex shooting conditions, demonstrating strong generalization ability. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the overall operation process of the formaldehyde concentration detection method based on image recognition according to the present invention. Detailed Implementation

[0019] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.

[0020] like Figure 1 As shown, a formaldehyde concentration detection method based on image recognition includes the following steps: S1. Standard Solution Color Development: Take 9 colorimetric tubes of the same specification, and prepare formaldehyde standard colorimetric solutions of different concentrations in each colorimetric tube, including the following sub-steps: S11. Preparation: Prepare the following solutions in advance: phenol reagent solution (concentration 0.1g / L, weigh 0.01g of phenol reagent, dilute to 100mL with distilled water, shake well and store at 2-8℃, shelf life strictly controlled within 7 days, if expired, it needs to be prepared again), ferric ammonium sulfate solution (concentration 10g / L, weigh 1g of ferric ammonium sulfate, add a small amount of distilled water to dissolve, add 2 drops of concentrated sulfuric acid to prevent ferric ions from hydrolyzing and producing precipitation, dilute to 100mL and store at room temperature, shake well and set aside), and formaldehyde standard stock solution (concentration 100μg / mL, commercially available standard or self-prepared, refrigerated storage). Then clean and disinfect the selected colorimetric tubes. S12. Preparation of Standard Series: After cleaning and disinfecting, prepare formaldehyde standard solutions of different concentrations in the colorimetric tubes. The concentration gradient is set to 0 μg / mL, 0.1 μg / mL, 0.2 μg / mL, 0.4 μg / mL, 0.6 μg / mL, and 0.8 μg / mL, covering the conventional detection range. Three parallel samples should be set up for each group during preparation to avoid errors. The formaldehyde standard solutions are prepared by mixing formaldehyde standard stock solution, phenol reagent solution and distilled water in different proportions, and must be thoroughly shaken during the preparation process. S13. Colorimetric reaction: Add ferric ammonium sulfate solution to each colorimetric tube and gently invert and shake to mix (avoid vigorous shaking to prevent air bubbles). Then place the colorimetric tubes in a constant temperature water bath, control the ambient temperature at 25±2℃, completely wrap them with black light-proof cloth to protect them from light, and let them stand for 10-20 minutes to complete the colorimetric reaction (formaldehyde reacts with phenol reagent to form a azine, and the azine reacts with ferric ammonium sulfate to form a blue-green complex; the higher the concentration, the deeper the color). S14. Inspection and handling: Observe all colorimetric solutions to ensure that there is no turbidity, no precipitation, no bubbles, and the color is uniform. If layering, flocculent precipitation, or bubbles that cannot be eliminated occur, discard the set of standard solutions immediately and prepare a new set. The standard solutions must be prepared a new set to rule out problems such as reagent deterioration and operational errors. S2. Image Acquisition: Acquire standardized images of the colorimetric solution and screen the acquired images to eliminate interference factors such as lighting, angle, and background. Ensure the correspondence between image features and formaldehyde concentration to provide high-quality samples for subsequent dataset construction and AI training. When acquiring images, use a white LED surface light source (uniform brightness, no shadows, illuminance controlled at 500±50 lux). The vertical distance between the light source and the colorimetric tube should be 30cm to avoid direct strong light or insufficient light. Use a pure white non-reflective background board (size not less than 20cm×20cm) to ensure that the background is free of debris and color interference. The ambient temperature for taking pictures should be maintained at 25±2℃ to avoid color shift of the colorimetric solution caused by temperature changes. When taking pictures, use a colorimetric tube holder to fix the colorimetric tubes and ensure that all colorimetric tubes are placed at the same height (tube opening horizontal with lens) and angle (lens vertically aligned with the center of the colorimetric tube). The distance between the lens and the colorimetric tube should be fixed at 40cm. When taking pictures, each colorimetric tube should be photographed sequentially, with 3 pictures taken for each parallel sample. Each image should be named separately. S3. Dataset Construction: Standardized images are preprocessed and labeled to construct training, validation, and test sets, ensuring the diversity and accuracy of the datasets and providing effective data support for AI model training. This includes the following sub-steps: S31. Image Preprocessing: The qualified images after screening are uniformly processed to eliminate irrelevant interference and extract effective features. Preprocessing includes cropping, denoising, and normalization. The screening criteria are that the image is clear and not blurry, the color developing liquid area is complete, and there is no additional light and shadow interference. Cropping is done using image editing tools to crop the image to retain only the color developing liquid area in the colorimetric tube (removing irrelevant parts such as the colorimetric tube wall, background, and scale). The uniform cropping size is 500×500 pixels. Denoising is done using a Gaussian filtering algorithm to remove slight noise in the image (such as dust and light spots) while maintaining the authenticity of the color developing liquid color and not changing the color characteristics of the image. Normalization is to normalize the pixel values ​​of the image to the range of 0-255. The image brightness and contrast are unified through linear transformation, with the deviation controlled within ±5%. This ensures that the images taken in different batches have consistency. S32. Image annotation: Use annotation tools to accurately annotate the preprocessed image. The annotation content includes category annotation and color feature annotation. After the annotation is completed, the annotation verification must be performed to ensure that the annotation accuracy is 100%. If there is any inconsistency in the annotation, it must be re-checked and corrected. S33. Dataset Partitioning: Divide the labeled images into training, validation, and test sets in a 7:2:1 ratio. Randomly shuffle the samples during partitioning to ensure uniform concentration distribution across datasets. The training set is used to train the AI ​​model, learning the correspondence between formaldehyde concentration and color rendering images. During training, a loss function is used to measure prediction bias. The core loss function (mean squared error, MSE) of the regression model is as follows: ; in: Number of training samples; : The actual formaldehyde concentration of the sample; Model predicts formaldehyde concentration; S34. Dataset saving: Save the divided dataset in a directory structure of training set, validation set, test set-concentration-image name, and save the annotation file at the same time for easy model calling and maintenance later; S4. Core Recognition Model Construction: A suitable AI model for image classification and regression is selected, and a model structure is built based on a deep learning framework. The input is set to the preprocessed image of the color-developing solution, and the output is set to the predicted formaldehyde concentration value (continuous value) or concentration category (classification value). The intermediate layers include convolutional layers, pooling layers, and fully connected layers. The convolutional layers are used to extract features such as blue-green color depth and texture; the pooling layers are used to compress feature dimensions; and the fully connected layers are used to map concentration values, extract image color features, and establish a mapping relationship between features and concentration. Training parameters also need to be set, such as setting the initial learning rate to 0.001 and using an adaptive learning rate adjustment strategy, gradually increasing the learning rate as training rounds increase. To reduce learning rate and avoid model oscillations, the batch size is set to 16 or 32, adjusted according to hardware configuration, to ensure training efficiency and stability. The initial training epochs are set to 50. After each epoch, the accuracy is evaluated using a validation set. If the validation set accuracy shows no improvement for five consecutive epochs, an early stopping strategy is triggered. If the validation set accuracy no longer improves, training is stopped (early stopping strategy) to avoid overfitting. Mean squared error (MSE) or cross-entropy loss function (suitable for concentration regression) is used as the loss function to measure the deviation between the model's predicted values ​​and the actual concentrations. After setting these parameters, model training is performed. After training, the model performance is evaluated using a test set. Core evaluation metrics include: Recognition accuracy: The mean absolute error of the regression model is ≤0.3μg / mL, calculated using the following formula: ; Generalization ability: Test the images of the color developing solution taken in different batches and under different environments to ensure that the model can still accurately identify under slight interference (such as light fluctuations and slight color deviations); Optimization and adjustment: If the model performance does not meet the requirements, adjust the training parameters, supplement the training data, or optimize the image preprocessing steps, and retrain until the detection requirements are met; S5. Sample Collection: Guide customers to collect color images of the samples to be tested according to standardized requirements, clearly inform them of the requirements for shooting equipment, lighting, distance, angle, etc., provide shooting templates for reference, ensure that the uploaded images meet the recognition requirements of the AI ​​model, reduce detection errors. After the customer uploads the images, the system automatically performs a preliminary check on the image clarity and the integrity of the color area. If the image is not up to standard, the system will remind the customer to retake the image. S6, AI Correction: Eliminates image deviations caused by factors such as customer shooting environment and operational errors. It performs brightness compensation for lighting deviations, white balance correction for color casts, geometric correction for angle deviations, and correction of uploaded images to be tested to ensure the accuracy of AI model recognition and reduce system errors. S7. Output of Detection Results: Based on the AI-corrected image, the formaldehyde concentration of the sample to be tested is output through model prediction and concentration conversion, ensuring that the results are accurate, intuitive, and meet the testing standards. The specific operation process includes: S71. Model Prediction: Input the AI-corrected image to be detected into the deployed AI model. Based on the learned mapping relationship between concentration and image features, the model outputs a predicted formaldehyde concentration value (continuous value) or concentration category. S72. Concentration Conversion: If the model output is a concentration category, it is converted into a specific concentration value by combining the concentration range of the standard series (taking the median value of the category, or further refining it according to image features). If the model output is a continuous value, it is directly used as the preliminary concentration result. S73. Error Correction: By combining the image features of the blank sample, the concentration result of the sample to be tested is corrected to eliminate systematic errors caused by reagent blanks and environmental interference. S74. Result Judgment Output: Based on national formaldehyde testing standards, determine whether the test results are qualified (e.g., the indoor formaldehyde limit is 0.10 mg / m³). If air sampling testing is involved, the concentration of the colorimetric reagent needs to be converted to the formaldehyde concentration in the air. The conversion formula includes: Formula for converting sampling volume under standard conditions: ; in: Sampling volume under standard conditions; : Sampling volume; : Temperature at the sampling point; Absolute temperature under standard conditions; Atmospheric pressure at the sampling point; Atmospheric pressure under standard conditions; Calculation of formaldehyde concentration in the air: ; in: Formaldehyde concentration in the air; : Absorbance of the sample solution; : Absorbance of blank solution; : Calculation factor; : Sampling volume under standard conditions.

[0021] The embodiments of the present invention are given for illustrative and descriptive purposes only, and are not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention, and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.

Claims

1. A formaldehyde concentration detection method based on image recognition, characterized in that, The method includes the following steps: S1. Standard solution color development: Take 9 colorimetric tubes of the same specification, and prepare formaldehyde standard solutions of different concentrations in each colorimetric tube. After adding the color development solution, let them show different colors. S2. Image Acquisition: Acquire standardized images of the colorimetric solution and screen the acquired images to ensure the correspondence between image features and formaldehyde concentration, so as to provide high-quality samples for subsequent dataset construction and AI training. S3. Dataset Construction: Standardized images are preprocessed and labeled to construct training, validation, and test sets, ensuring the diversity and accuracy of the datasets and providing effective data support for AI model training. S4. Core Recognition Model Construction: Select an AI model suitable for image classification and regression, and build the model structure based on the deep learning framework. Set the input as the preprocessed color developing liquid image, and the output as the formaldehyde concentration prediction value or concentration category. Set convolutional layer, pooling layer, and fully connected layer in the middle layer to extract image color features and establish the mapping relationship between features and concentration. S5. Sample Collection: Guide customers to collect colorimetric images of samples to be tested according to standardized requirements, ensuring that the uploaded images meet the recognition requirements of the AI ​​model and reduce detection errors; S6, AI Correction: Eliminates image deviations caused by factors such as the customer's shooting environment and operational errors, corrects the uploaded images to be detected, ensures the accuracy of AI model recognition, and reduces system errors; S7. Output of Detection Results: Based on the AI-corrected image, the formaldehyde concentration of the sample to be tested is output through model prediction and concentration conversion, ensuring that the results are accurate, intuitive, and meet the testing standards. The specific operation process includes: S71. Model Prediction: Input the AI-corrected image to be detected into the deployed AI model. Based on the learned mapping relationship between concentration and image features, the model outputs the predicted formaldehyde concentration or concentration category. S72. Concentration Conversion: If the model output is a concentration category, it is converted into a specific concentration value by combining the concentration range of the standard series. If the model output is a continuous value, it is directly used as the preliminary concentration result. S73. Error Correction: By combining the image features of the blank sample, the concentration result of the sample to be tested is corrected to eliminate systematic errors caused by reagent blanks and environmental interference. S74. Result Judgment Output: Based on the national formaldehyde testing standards, determine whether the test results are qualified. If air sampling is involved, the concentration of the colorimetric reagent needs to be converted to the formaldehyde concentration in the air. The conversion formula includes: Formula for converting sampling volume under standard conditions: ; in: Sampling volume under standard conditions; : Sampling volume; : Temperature at the sampling point; Absolute temperature under standard conditions; Atmospheric pressure at the sampling point; Atmospheric pressure under standard conditions; Calculation of formaldehyde concentration in the air: ; in: Formaldehyde concentration in the air; : Absorbance of the sample solution; : Absorbance of blank solution; : Calculation factor; : Sampling volume under standard conditions.

2. The formaldehyde concentration detection method based on image recognition according to claim 1, characterized in that, Step S1 includes the following sub-steps: S11. Preparation: Prepare phenol reagent solution, ferric ammonium sulfate solution and formaldehyde standard stock solution in advance, and then clean and dry the selected colorimetric tubes. S12. Preparation of standard series: Prepare formaldehyde standard solutions of different concentrations in clean colorimetric tubes. Parallel samples should be set up for each group during preparation to avoid errors. S13. Colorimetric reaction: Add ferric ammonium sulfate solution to each colorimetric tube and gently invert and shake well. Then place the colorimetric tubes in a constant temperature environment of 25±2℃ and let them stand in the dark for 15 minutes to complete the colorimetric reaction. S14. Inspection and handling: Observe all colorimetric solutions to ensure that there is no turbidity, no precipitation, no bubbles, and the color is uniform. If any abnormality is found, the standard solution for that group must be prepared again.

3. The formaldehyde concentration detection method based on image recognition according to claim 2, characterized in that, The formaldehyde standard solution in step S12 is prepared by mixing formaldehyde standard stock solution, phenol reagent solution and distilled water in different proportions, and must be thoroughly shaken during preparation.

4. The formaldehyde concentration detection method based on image recognition according to claim 1, characterized in that, In step S2, a white LED surface light source must be used when acquiring images. The vertical distance between the light source and the colorimeter tube should be 30cm. A pure white non-reflective background board should be used to ensure that there are no impurities or color interference in the background. The ambient temperature for taking pictures should be maintained at 25±2℃.

5. The formaldehyde concentration detection method based on image recognition according to claim 4, characterized in that, When taking photos, a colorimeter holder must be used to fix the colorimeter tubes, and all colorimeter tubes must be placed at the same height and angle. The distance between the lens and the colorimeter tube must be fixed at 40cm. Furthermore, each colorimeter tube must be photographed sequentially, with 3 photos taken for each parallel sample, and each image must be named separately.

6. The formaldehyde concentration detection method based on image recognition according to claim 1, characterized in that, Step S3 includes the following sub-steps: S31. Image preprocessing: The qualified images after screening are uniformly processed to eliminate irrelevant interference and extract effective features; S32. Image annotation: Use annotation tools to accurately annotate the preprocessed image. The annotation content includes category annotation and color feature annotation. After the annotation is completed, the annotation verification must be performed to ensure that the annotation accuracy is 100%. If there is any inconsistency in the annotation, it must be re-checked and corrected. S33. Dataset Partitioning: The labeled images are divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used to train the AI ​​model, learning the correspondence between formaldehyde concentration and color rendering images. During training, a loss function is used to measure prediction bias. The core loss function formula for the regression model is: ; in: Number of training samples; : The actual formaldehyde concentration of the sample; Model predicts formaldehyde concentration; S34. Dataset saving: Save the divided dataset in a directory structure of training set, validation set, test set-concentration-image name, and save the annotation files at the same time for easy model calling and maintenance.

7. The formaldehyde concentration detection method based on image recognition according to claim 6, characterized in that, The preprocessing in step S31 includes cropping, noise reduction, and normalization. Cropping is done using an image editing tool to crop the image to retain only the colorimetric liquid area in the colorimetric tube, with a uniform cropping size of 500×500 pixels.

8. The formaldehyde concentration detection method based on image recognition according to claim 7, characterized in that, The denoising process employs a Gaussian filtering algorithm to remove minor noise from the image, maintaining the authenticity of the color of the developing solution without altering the image's color characteristics. Normalization, on the other hand, normalizes the pixel values ​​of the image to the range of 0-255, unifying the image's brightness and contrast.

9. The formaldehyde concentration detection method based on image recognition according to claim 1, characterized in that, In step S4, the training parameters of the model also need to be set. For example, the initial learning rate is set to 0.001, and an adaptive learning rate adjustment strategy is adopted. As the number of training rounds increases, the learning rate is gradually reduced to avoid model oscillation. The batch size is set to 16 or 32, which is adjusted according to the hardware configuration to ensure training efficiency and stability. The initial number of training rounds is set to 50 rounds. If the accuracy of the validation set no longer improves, training is stopped to avoid overfitting. The mean squared error or cross-entropy loss function is used as the loss function to measure the deviation between the model's predicted value and the actual concentration. After setting, the model training process is performed.

10. The formaldehyde concentration detection method based on image recognition according to claim 9, characterized in that, After the model is trained, its performance is evaluated using a test set. The core evaluation metrics include: Recognition accuracy: The mean absolute error of the regression model is ≤0.3μg / mL, calculated using the following formula: ; Generalization ability: Test the images of the colorimetric liquid taken in different batches and under different environments to ensure that the model can still accurately identify under slight interference; Optimization and adjustment: If the model performance does not meet the requirements, adjust the training parameters, supplement the training data, or optimize the image preprocessing steps, and retrain until the detection requirements are met.