Image processing method and device, computer device and storage medium
By training the equipment to recognize the model, the image of liquefied gas equipment is automatically recognized, which solves the problem of low efficiency in traditional manual review and realizes an efficient and accurate security inspection process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN JINNUO CLOUD CHAIN TECHNOLOGY CO LTD
- Filing Date
- 2025-05-23
- Publication Date
- 2026-06-19
Smart Images

Figure CN120580693B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security inspection, and more particularly to an image processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In today's society, the use of bottled liquefied petroleum gas (LPG) remains relatively high. When these bottles are delivered to users' homes, they undergo safety inspections to check for potential gas safety hazards. Traditionally, LPG delivery personnel or users take photos of the LPG equipment and upload them to a safety inspection platform. The images are then manually reviewed to ensure they meet the required standards. However, this manual review process is resource-intensive and inefficient. Therefore, developing an image processing method that improves inspection efficiency is a pressing issue. Summary of the Invention
[0003] Therefore, it is necessary to provide an image processing method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems and solve the problem of low security inspection efficiency of traditional methods.
[0004] Acquire images of the equipment to be inspected and a trained equipment recognition model. The equipment images include at least one liquefied gas device. The trained equipment recognition model is trained based on preset security inspection configuration information.
[0005] Based on the trained equipment recognition model, the equipment image is processed to obtain the recognition result of at least one of the liquefied gas devices in the equipment image;
[0006] Based on the identification results of the liquefied gas equipment, it is determined whether the image of the equipment to be inspected complies with the security inspection shooting specifications.
[0007] Optionally, before obtaining the trained device recognition model, the method further includes:
[0008] Obtain the device recognition model to be trained and sample device images;
[0009] Based on the preset security check configuration information, the sample device image is labeled to obtain the image label of the sample device image;
[0010] A training set is constructed based on the sample device images and the corresponding image labels;
[0011] The device recognition model to be trained is trained based on the training set to obtain the trained device recognition model.
[0012] Optionally, the step of annotating the sample device image based on the preset security check configuration information to obtain the image tag for the sample device image includes:
[0013] Based on the preset security inspection configuration information, the target device, its device category, and image coordinates are determined in each sample device image;
[0014] Based on the device category and image coordinates of each target device in the sample device image, the image label of the sample device image is determined.
[0015] Optionally, the step of training the device recognition model to be trained based on the training set to obtain the trained device recognition model includes:
[0016] The training set is provided to the device recognition model to be trained for recognition processing to obtain the recognition result of the training set;
[0017] The loss value of the recognition result is calculated based on a preset loss function;
[0018] With minimizing the loss value as the optimization objective, the parameters of the device recognition model to be trained are adjusted using the backpropagation algorithm. The parameter adjustment process is iterated until the loss value converges at the minimum or the number of iterations reaches a preset value, at which point training stops, and the trained device recognition model is obtained.
[0019] Optionally, the parameters of the device recognition model to be trained include basic parameters and enhancement parameters. The basic parameters are used to adjust the learning strategy during the training process, and the enhancement parameters are used to adjust the image parameters of the sample device images in the training set.
[0020] Optionally, the identification result includes the device category and identification confidence level. The step of determining whether the image of the device to be inspected conforms to the security inspection shooting specifications based on the identification result of the liquefied gas device includes:
[0021] The identification confidence level of each type of liquefied gas equipment is compared with a preset confidence threshold to obtain the comparison result of each type of liquefied gas equipment.
[0022] Based on the comparison results of liquefied gas equipment for each equipment category, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specifications.
[0023] Optionally, determining whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the comparison results of liquefied gas equipment for each equipment category includes:
[0024] If the comparison results for all types of liquefied gas equipment show that the identification confidence level is greater than the preset confidence level threshold, then the image of the equipment to be inspected is determined to meet the security inspection shooting specifications.
[0025] If the identification confidence level of any type of liquefied gas equipment is not greater than the preset confidence level threshold, then the image of the equipment to be inspected is determined to be inconsistent with the security inspection shooting specifications.
[0026] An image processing apparatus, comprising:
[0027] The acquisition module is used to acquire images of the equipment to be inspected and a trained equipment recognition model. The equipment image includes at least one liquefied gas device, and the trained equipment recognition model is trained based on preset security configuration information.
[0028] The recognition module is used to process the equipment image based on the trained equipment recognition model to obtain the recognition result of at least one of the liquefied gas devices in the equipment image;
[0029] The determination module is used to determine whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the identification result of the liquefied gas equipment.
[0030] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the image processing method described above when executing the computer-readable instructions.
[0031] A readable storage medium storing computer-readable instructions thereon, which, when executed by a processor, implement the above-described image processing method.
[0032] The aforementioned image processing method, apparatus, computer equipment, and storage medium acquire an image of a device to be inspected and a trained device recognition model. The device image includes at least one liquefied petroleum gas (LPG) device. The trained device recognition model is trained based on preset security inspection configuration information. The device image is processed using the trained device recognition model to obtain the recognition result of at least one LPG device in the image. Based on the recognition result of the LPG device, it is determined whether the image of the device to be inspected conforms to security inspection shooting specifications. By processing the device image using the trained device recognition model, the recognition result of at least one LPG device can be efficiently obtained. Since the trained device recognition model is obtained through preset security inspection configuration information, the recognition result can be obtained efficiently while accurately determining whether the image of the device to be inspected conforms to security inspection shooting specifications. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a schematic flowchart of an image processing method according to an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram illustrating the effect of the identification result of a liquefied gas device in one embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the structure of an image processing device according to an embodiment of the present invention;
[0037] Figure 4 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] In one embodiment, such as Figure 1 As shown, an image processing method is provided, including the following steps:
[0040] 101. Obtain images of the equipment to be inspected and the trained equipment recognition model.
[0041] In this embodiment of the invention, the above-described image processing method can also be applied to a security inspection platform. The security inspection platform can be constructed by a server or server cluster. The server or server cluster can be any electronic device with functions such as image recognition, image processing, image analysis, data storage, and data transmission.
[0042] The above equipment images include at least one liquefied petroleum gas (LPG) device, which may be a gas cylinder pressure reducing valve, a gas leak alarm, a gas stove, a gas water heater, a pipeline, a gas cylinder, or a shut-off valve, etc.
[0043] The trained device recognition model described above can be trained based on preset security check configuration information. Specifically, this security check configuration information can be set according to security check requirements, and is used to define the list of objects to be detected and their corresponding categories. The trained device recognition model can be obtained by training any deep learning model using the preset security check configuration information.
[0044] When liquefied petroleum gas (LPG) cylinders are delivered to users, a safety inspection is required according to policy. This inspection checks for potential gas safety hazards in the user's home (i.e., checks for potential gas safety hazards in LPG appliances). The images of the appliances to be inspected can be taken by the delivery personnel using any smart device and uploaded to the aforementioned safety inspection platform.
[0045] 102. Based on the trained equipment recognition model, the equipment image is processed to obtain the recognition result of at least one liquefied gas device in the equipment image.
[0046] In this embodiment of the invention, the above-mentioned equipment image can be input into the above-trained equipment recognition model to obtain the recognition result of at least one liquefied gas equipment in the above-mentioned equipment image. The recognition result may include the equipment category and the recognition confidence level.
[0047] The aforementioned recognition process refers to the process of feature extraction and classification of the input image. Specifically, spatial feature extraction can be achieved through multi-layer convolutional kernel operations, and the classifier outputs the device category and location information. Alternatively, the trained device recognition model can also be a trained YOLO11n model. The device image is provided to the trained YOLO11n model, and the output of the trained YOLO11n model (i.e., the device category and the image coordinates) is used as the recognition result of the liquefied gas device.
[0048] Specifically, the identification results of the aforementioned liquefied gas equipment can be obtained through methods such as... Figure 2 The schematic diagram illustrating the recognition results of a liquefied gas device further explains... Figure 2 The document includes six images of devices to be inspected, each image containing at least one identification box. These identification boxes can be generated based on image coordinates. Each identification box has a device category (e.g., numbers 0, 3, 5) in its upper left corner, with different numbers corresponding to different device categories.
[0049] 103. Based on the identification results of liquefied gas equipment, determine whether the image of the equipment to be inspected meets the security inspection shooting specifications.
[0050] In this embodiment of the invention, traditional image processing methods often require manual review of the uploaded images of the equipment to be inspected to determine whether the content meets the photography specifications. This review process requires a large amount of manual intervention. However, by using the identification results of the liquefied gas equipment, it is possible to accurately determine whether the images of the equipment to be inspected meet the security inspection photography specifications. This reduces the amount of manual review required to ensure that the images of the equipment to be inspected do not meet the specifications and prevents delivery personnel or users from taking images of the equipment to be inspected in a manner that does not comply with the specifications.
[0051] The aforementioned security inspection photography specifications can be understood as whether the liquefied gas equipment is captured completely, or whether the image of the equipment to be inspected contains all the configuration items required by the preset security inspection configuration information. Each configuration item corresponds to one device.
[0052] Compared to existing technologies, traditional methods rely entirely on human experience to judge image compliance, resulting in subjective judgment bias and efficiency bottlenecks. This solution automates equipment detection by training a recognition model with specific security check configurations. The model can quickly perform image feature analysis, avoiding the inefficient operation of manual image-by-image inspection. Furthermore, the recognition standard established based on unified security check configuration information eliminates discrepancies in judgment among different reviewers, improving the consistency of review results. Moreover, when security check configuration information changes, the trained equipment recognition model can be promptly updated based on the revised configuration.
[0053] Through the above technical solution, this application achieves automated processing of safety inspections of liquefied petroleum gas (LPG) equipment. Machine learning-based image recognition technology significantly shortens the review time and effectively reduces reliance on human resources. By training the model with pre-set safety inspection configuration information, it ensures a high degree of consistency between inspection standards and safety regulations, avoiding misjudgments and missed inspections caused by human factors. This method can process equipment image data in real time, promptly identify potential safety hazards, and provide reliable technical support for the safety management of LPG equipment.
[0054] In this embodiment of the invention, an image of a device to be inspected and a trained device recognition model are acquired. The device image includes at least one liquefied petroleum gas (LPG) device. The trained device recognition model is trained based on preset security inspection configuration information. The device image is processed using the trained device recognition model to obtain the recognition result of at least one LPG device in the image. Based on the recognition result of the LPG device, it is determined whether the image of the device to be inspected conforms to the security inspection shooting specifications. By processing the device image using the trained device recognition model, the recognition result of at least one LPG device can be obtained efficiently. Since the trained device recognition model is obtained through preset security inspection configuration information, the recognition result can be obtained efficiently, and the conformity of the image of the device to be inspected can be accurately determined based on the recognition result.
[0055] It is understood that in the specific implementation of this application, data related to the equipment image to be inspected, the preset security configuration information, and the sample equipment image are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required. Furthermore, the collection, use and processing of related data, as well as the construction, training and use of the equipment identification model, must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0056] Optionally, before obtaining the trained device recognition model, the device recognition model to be trained and sample device images can be obtained; based on the preset security inspection configuration information, the sample device images are labeled to obtain image labels for the sample device images; a training set is constructed based on the sample device images and their corresponding image labels; the device recognition model to be trained is trained based on the training set to obtain the trained device recognition model.
[0057] In this embodiment of the invention, the device recognition model to be trained refers to a neural network model (e.g., yolov11n) with initial parameters but not yet trained. Specifically, it can be implemented using a convolutional neural network architecture to extract features from sample device images and output recognition results.
[0058] Among them, the sample equipment images refer to a collection of images containing liquefied gas equipment and having diverse scene characteristics. Specifically, this can be achieved by collecting photos of liquefied gas equipment in different environments, which can be used to provide a data foundation for model training.
[0059] Image labels refer to structured data that labels the category and location information of liquefied gas equipment in sample equipment images. Specifically, this can be achieved by using object detection and labeling tools to select and classify equipment in the image, which is used to guide the model in learning equipment features.
[0060] The training set refers to a data set consisting of sample device images and their corresponding image labels. Specifically, it can be achieved by randomly dividing the sample data while maintaining the correspondence between images and labels, and is used to drive the optimization process of model parameters.
[0061] Specifically, the device recognition model to be trained is first initialized as a convolutional neural network with a basic network structure. Guided by pre-set security inspection configuration information, sample device images are labeled with the location coordinates and device category of each liquefied gas device in the image using a labeling tool, forming image labels containing bounding box coordinates and classification information. The labeled sample device images and their corresponding image labels are divided into training and validation sets according to a preset ratio. During training, the sample images in the training set are input into the device recognition model. The model's output prediction results are compared with the true annotations in the image labels. The model parameters are adjusted using the backpropagation algorithm, iteratively optimizing until the model reaches the preset convergence condition.
[0062] Compared to existing technologies, traditional methods rely on manual image annotation and review, which is time-consuming and prone to subjective errors. This solution, however, automates image label generation using pre-set security check configuration information, combined with a batch model training process, effectively reducing manual intervention and improving annotation efficiency and model training consistency.
[0063] Through the above technical solution, this application realizes the automated training process of the device recognition model, solves the problem of model update lag caused by the low efficiency of traditional manual annotation, and provides reliable model support for the rapid and accurate recognition of subsequent device images.
[0064] Optionally, in the step of annotating the sample device images based on preset security inspection configuration information to obtain image labels for the sample device images, the target device, its device category, and image coordinates can also be determined in each sample device image based on the preset security inspection configuration information; and the image label of the sample device image can be determined based on the device category and image coordinates of each target device in the sample device image.
[0065] In this embodiment of the invention, the preset safety inspection configuration information may include at least one configuration item, which may be category label 1 (i.e., valve, gas cylinder pressure reducing valve), 3 (i.e., leak_alarm, gas leak alarm), 4 (i.e., stove, gas stove), 5 (i.e., heater, gas water heater), 6 (i.e., pipeline), 7 (i.e., cylinder), 8 (i.e., shut_off_valve, shut-off valve), or 9 (i.e., rectification_notice, rectification notice), etc.
[0066] The target device refers to the liquefied petroleum gas (LPG) equipment to be identified in the sample image. Which LPG equipment needs to be identified in the specific sample image depends on the configuration items in the preset safety inspection configuration information mentioned above. This identification can be achieved using object detection algorithms such as YOLO or Faster R-CNN, whose function is to accurately locate the equipment area from complex backgrounds. The equipment category refers to the classification identifier of the LPG equipment, such as a gas cylinder pressure reducing valve, a gas leak alarm, or a gas stove. This can be achieved using a classification model or rule matching algorithm to address the potential misclassification issues that may arise from manual annotation in traditional methods. Image coordinates refer to the location information of the target device in the image. This can be labeled using bounding box coordinates or keypoint coordinates, for example, generated using image processing functions in the OpenCV library. Its purpose is to provide spatial localization information for model training.
[0067] Specifically, in the process of annotating sample device images, firstly, a pre-trained detection model, combined with configuration items in the security inspection configuration information, scans the image and identifies all target devices. Next, based on the device category mapping table defined in the configuration information, the target objects in the detection results are matched with preset categories to generate corresponding classification labels. Simultaneously, the coordinate extraction module records the vertex coordinates or center point coordinates of the bounding box of the target device. Finally, the device category and image coordinates are combined to form structured label data, which serves as the image label for the sample device. For example, when a gas cylinder pressure reducing valve is detected in the image, its category label is "1," and the coordinate labels are the x-coordinate of the midpoint of the recognition box, the y-coordinate of the center point, the width of the recognition box, and the height of the recognition box. It should be noted that the aforementioned device category mapping table includes the correspondence between category labels and device categories. For example, the correspondence between category label 1 and the device category gas cylinder pressure reducing valve, the correspondence between category label 3 and the gas leak alarm, and the correspondence between category label 4 and the gas stove, etc.
[0068] Specifically, the image labels mentioned above can be in the format of a .txt file, with each line formatted as <category number>.<x_center><y_center> <width> <height>The category number (i.e., the category label mentioned above) is one of the categories.<x_center> The x-coordinate of the midpoint of the above recognition box is...<y_center> The ordinate of the center point of the above recognition box is y. <width>To identify the width of the bounding box, <height>This is the height of the recognition box.
[0069] Compared to existing technologies, traditional methods typically rely on manual labeling of device categories and locations, resulting in low labeling efficiency and inconsistent standards. This solution, however, automates the labeling process by combining preset rules with algorithms to generate standardized label data in batches, significantly reducing manual intervention and improving labeling speed and consistency.
[0070] Through the above technical solution, this application solves the problems of low efficiency and error-proneness in the traditional sample labeling process, and realizes rapid and accurate labeling of equipment category and spatial location information, providing a high-quality data foundation for subsequent model training, thereby improving the accuracy of the equipment recognition model and the reliability of the security inspection process.
[0071] Optionally, in the step of training the device recognition model to be trained based on the training set to obtain a trained device recognition model, the training set can also be provided to the device recognition model to be trained for recognition processing to obtain the recognition result of the training set; the loss value of the recognition result is calculated based on a preset loss function; with the goal of minimizing the loss value, the parameters of the device recognition model to be trained are adjusted through the backpropagation algorithm, and the parameter adjustment process is iterated until the loss value converges at the minimum, or the number of iterations reaches a preset value, at which point training is stopped, and a trained device recognition model is obtained.
[0072] In this embodiment of the invention, the training set refers to the dataset used for model training. Specifically, it can be constructed using sample device images labeled with device category and coordinate information. By mapping sample images to labels, the model learns the mapping relationship between features and the target. The loss function is a mathematical function that measures the difference between the model's prediction result and the true label. Specifically, it can be implemented using cross-entropy loss or mean squared error function, quantifying the prediction error to guide the optimization of model parameters. The backpropagation algorithm is a calculation method for adjusting the weights of a neural network based on the gradient descent principle. Specifically, it can calculate the contribution of each parameter to the loss value layer by layer using the chain rule, thereby updating the parameters to reduce the error. Parameter tuning refers to the process of iteratively optimizing the weights within the model. Specifically, it can control the optimization speed and stability by adjusting hyperparameters such as the learning rate and momentum factor, allowing the model to gradually approach the optimal solution.
[0073] Specifically, after the training set is input into the device recognition model, the model extracts features and predicts the category of the sample device images, outputting the recognition result. The loss function compares the prediction result with the true label, generating a loss value that reflects the current error level of the model. The backpropagation algorithm calculates the gradient information of the parameters of each layer based on the loss value and updates the weights iteratively. During training, parameter adjustments continue until the loss value tends to stabilize or reaches the preset number of iterations, at which point the model has sufficient recognition accuracy and generalization ability.
[0074] It should be noted that the parameters of the device recognition model to be trained include basic parameters and augmentation parameters. The basic parameters are used to adjust the learning strategy during the training process, while the augmentation parameters are used to adjust the image parameters of the sample device images in the training set.
[0075] Basic parameters refer to the parameters that control the learning behavior of the model during training. Specifically, they can include Epochs = 100 (total number of training epochs), imgsz = 720 (target image size), optimizer = AdamW (selecting the optimizer), multi_scale = True (increasing / decreasing the coefficient of imgsz), cos_lr = True (using the cosine learning rate scheduler), and lr0 = 0.0005 (initial learning rate). Adjusting these basic parameters can optimize the model's convergence speed and training stability.
[0076] Among them, enhancement parameters refer to the parameters used to perform data augmentation processing on training images. Specifically, they can include hsv_h (i.e., dynamically changing different lighting conditions), hsv_s (i.e., dynamically changing image saturation), hsv_v (i.e., dynamically changing image values (brightness)), degrees (i.e., dynamically rotating the image randomly), translate (i.e., dynamically translating horizontally and vertically), scale (i.e., dynamically scaling the image), shear (i.e., cropping the image at a specified angle), perspective (i.e., random perspective transformation), and flipud (i.e., probabilistically flipping the image). Enhancement parameters can improve the diversity of training data and enhance the robustness of the model to image changes.
[0077] Specifically, during model training, basic parameters are configured to optimize learning strategies. For example, a strategy of dynamically adjusting the learning rate is used to avoid getting trapped in local optima, while the choice of optimizer type balances computational efficiency and model accuracy. Augmentation parameters are applied during the preprocessing stage of sample device images. For instance, adjusting brightness parameters to simulate device images under different lighting conditions, or generating image variants at different angles through rotation parameters, thereby expanding the coverage of the training set. The synergistic effect of multiple augmentation parameters enables the model to efficiently learn features during training while also possessing the ability to adapt to image differences in real-world scenarios.
[0078] Optionally, in the step of determining whether the image of the device to be inspected conforms to the security inspection shooting specifications based on the identification results of the liquefied gas device, a comparison can also be performed between the identification confidence level of the liquefied gas device for each device category and a preset confidence threshold to obtain the comparison results of the liquefied gas device for each device category; based on the comparison results of the liquefied gas device for each device category, it can be determined whether the image of the device to be inspected conforms to the security inspection shooting specifications.
[0079] In this embodiment of the invention, the identification result includes the device category and the identification confidence level. The device category refers to the classification result of the device identification model to which the liquefied gas equipment in the image belongs. Specifically, this can be achieved by extracting image features through a convolutional neural network and outputting a classification label. This feature is used to distinguish different types of liquefied gas equipment. The identification confidence level refers to the probabilistic confidence of the model in the identification result. Specifically, this can be achieved by converting the output of the device identification model into a probability value through a softmax function. This value reflects the reliability of the identification result. The preset confidence threshold refers to a pre-set judgment standard, which can be determined through experimental testing or empirical values. For example, it can be set to 0.9 to filter identification results that meet the confidence standard.
[0080] Specifically, after processing the equipment image, the equipment recognition model outputs the equipment category and recognition confidence score for each liquefied gas device. The confidence score for each equipment category is compared one by one with a pre-set threshold. If all equipment categories pass the threshold verification, the equipment image is determined to meet the security inspection shooting specifications; if any category fails to meet the standard, it is determined to not meet the security inspection shooting specifications.
[0081] In one possible embodiment, each device category can correspond to a preset confidence threshold. The preset confidence thresholds for different device categories can be the same or different, depending on the device category. For example, when the device category is a general-purpose device, which is easy to identify and has a low false positive rate (i.e., easy to identify), its corresponding confidence threshold can be set higher. Conversely, when the device category is a complex and easily confused device (i.e., difficult to identify), its corresponding confidence threshold can be set lower. Alternatively, for device categories involving high safety risks (e.g., alarms, pressure regulating valves, etc.), the aforementioned confidence threshold can be set higher, while for device categories involving low safety risks (e.g., wall brackets), the aforementioned confidence threshold can be set lower.
[0082] Specifically, the aforementioned confidence threshold can also be calculated using the following formula:
[0083]
[0084] in, Let represent the confidence threshold for the i-th device category. This is represented as the minimum confidence threshold. This represents the maximum confidence threshold. The range of values between the minimum confidence threshold and the maximum confidence threshold is the range of confidence threshold values. Represented as a weighting factor, its value ranges from [0,1], and it is used to adjust the influence ratio of "identification difficulty" and "security risk". This represents the recognition difficulty weight for the i-th device category; a larger value indicates greater difficulty in recognition. This represents the safety risk weight for the i-th equipment category; a larger value indicates a higher safety risk. If a certain equipment category is relatively easy to identify, such as a gas cylinder, then... The safety risk should be lower if a particular type of equipment poses a higher risk, such as a gas leak alarm. It should be relatively high.
[0085] Optionally, in the step of determining whether the image of the device to be inspected conforms to the security inspection shooting specifications based on the comparison results of liquefied gas devices for each device category, it can be further determined that the image of the device to be inspected conforms to the security inspection shooting specifications if the comparison results of liquefied gas devices for all device categories have an identification confidence level greater than a preset confidence level threshold; and if the identification confidence level of any liquefied gas device for any device category is not greater than a preset confidence level threshold, then it can be determined that the image of the device to be inspected does not conform to the security inspection shooting specifications.
[0086] In this embodiment of the invention, when the preset confidence threshold is a fixed value, such as 0.9, the recognition confidence of each equipment category can be compared with 0.9. If the comparison results of liquefied gas equipment of all equipment categories are that the recognition confidence is greater than the preset confidence threshold, then it is determined that the image of the equipment to be inspected meets the security inspection shooting specifications; if the recognition confidence of any equipment category of liquefied gas equipment is not greater than the preset confidence threshold, then it is determined that the image of the equipment to be inspected does not meet the security inspection shooting specifications.
[0087] In one possible embodiment, if each device category corresponds to a preset confidence threshold, i.e., there are multiple preset confidence thresholds, the recognition confidence of each device category can be compared with the corresponding confidence threshold to obtain the comparison result of each device category. If the comparison results of liquefied gas devices for all device categories show a recognition confidence greater than their corresponding preset confidence threshold, then the image of the device to be inspected is determined to meet the security inspection shooting specifications. If the recognition confidence of any liquefied gas device for any device category is not greater than its corresponding preset confidence threshold, then the image of the device to be inspected is determined to not meet the security inspection shooting specifications.
[0088] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0089] In one embodiment, an image processing apparatus is provided, which corresponds one-to-one with the image processing methods described in the above embodiments. For example... Figure 3 As shown, the image processing device includes an acquisition module 301, a recognition module 302, and a determination module 303. Detailed descriptions of each functional module are as follows:
[0090] The acquisition module 301 is used to acquire an image of the device to be inspected and a trained device recognition model. The device image includes at least one liquefied gas device, and the trained device recognition model is trained according to preset security configuration information.
[0091] The recognition module 302 is used to perform recognition processing on the equipment image based on the trained equipment recognition model to obtain the recognition result of at least one of the liquefied gas devices in the equipment image;
[0092] The determination module 303 is used to determine whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the identification result of the liquefied gas equipment.
[0093] Optionally, the image processing apparatus further includes:
[0094] The second acquisition module is used to acquire the device recognition model to be trained and sample device images;
[0095] The first annotation module is used to annotate the sample device image based on the preset security check configuration information to obtain the image label of the sample device image;
[0096] The first construction module is used to construct a training set based on the sample device images and the corresponding image labels;
[0097] The first training module is used to train the device recognition model to be trained based on the training set, so as to obtain the trained device recognition model.
[0098] Optionally, the first annotation module includes:
[0099] The first determining submodule is used to determine the target device, the device category of the target device, and the image coordinates of the target device in each sample device image based on the preset security inspection configuration information;
[0100] The second determining submodule is used to determine the image label of the sample device image based on the device category and image coordinates of each target device in the sample device image.
[0101] Optionally, the first training module includes:
[0102] The first recognition submodule is used to provide the training set to the device recognition model to be trained for recognition processing, and obtain the recognition result of the training set;
[0103] The first calculation submodule is used to calculate the loss value of the recognition result based on a preset loss function;
[0104] The first training submodule is used to optimize the device recognition model by minimizing the loss value, and then adjust the parameters of the device recognition model to be trained through the backpropagation algorithm. The parameter adjustment process is iterated until the loss value converges at the minimum or the number of iterations reaches a preset value, at which point the training stops and the trained device recognition model is obtained.
[0105] Optionally, the parameters of the device recognition model to be trained include basic parameters and enhancement parameters. The basic parameters are used to adjust the learning strategy during the training process, and the enhancement parameters are used to adjust the image parameters of the sample device images in the training set.
[0106] Optionally, the determining module 303 includes:
[0107] The first comparison submodule is used to compare the identification confidence of each type of liquefied gas equipment with a preset confidence threshold to obtain the comparison result of each type of liquefied gas equipment.
[0108] The third determination submodule is used to determine whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the comparison results of the liquefied gas equipment of each equipment category.
[0109] Optionally, the third determining submodule includes:
[0110] The first determining unit is configured to determine that the image of the device to be inspected conforms to the security inspection shooting specifications if the comparison results of all equipment categories of liquefied gas equipment are that the identification confidence level is greater than the preset confidence level threshold.
[0111] The second determining unit is used to determine that the image of the device to be inspected does not meet the security inspection shooting specifications if the identification confidence level of any type of liquefied gas device is not greater than the preset confidence level threshold.
[0112] Each module in the aforementioned image processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0113] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement an image processing method. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0114] In this application embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, it implements the steps of the image processing method described above.
[0115] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, they implement the steps of the image processing method described above.
[0116] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0118] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.< / height> < / width> < / height> < / width>
Claims
1. An image processing method, characterized by, The method includes: Acquire images of the equipment to be inspected and a trained equipment recognition model. The equipment images include at least one liquefied gas device. The trained equipment recognition model is trained based on preset security inspection configuration information. Based on the trained equipment recognition model, the equipment image is processed to obtain the recognition result of at least one of the liquefied gas devices in the equipment image; Based on the identification results of the liquefied gas equipment, it is determined whether the image of the equipment to be inspected complies with the security inspection shooting specifications; The identification result includes the equipment category and identification confidence level. Based on the identification result of the liquefied gas equipment, determining whether the image of the equipment to be inspected meets the security inspection shooting specifications includes: The identification confidence level of each type of liquefied gas equipment is compared with a preset confidence threshold to obtain the comparison result of each type of liquefied gas equipment. Each device category corresponds to a preset confidence threshold. The preset confidence thresholds for different device categories may be the same or different. When the device category is a general-purpose device, its identification is clear and the false judgment rate is low, that is, the identification difficulty is low, so the corresponding confidence threshold is set higher. Conversely, when the device category is a device with a complex shape and easy confusion, that is, the identification difficulty is high, so the corresponding confidence threshold is set lower. For equipment categories involving high safety risks, the aforementioned confidence threshold is set higher; for equipment categories involving low safety risks, the aforementioned confidence threshold is set lower. The equipment categories involving high safety risks include alarms and pressure regulating valves, while the equipment categories involving low safety risks include wall brackets. The confidence threshold mentioned above is specifically calculated using the following formula: in, Let represent the confidence threshold for the i-th device category. This is represented as the minimum confidence threshold. This represents the maximum confidence threshold. The range of values between the minimum confidence threshold and the maximum confidence threshold is the range of confidence threshold values. Represented as a weighting factor, its value ranges from [0,1], and it is used to adjust the influence ratio of "identification difficulty" and "security risk". This represents the recognition difficulty weight for the i-th device category; a larger value indicates greater difficulty in recognition. This represents the security risk weight for the i-th device category; a larger value indicates a higher security risk. If a certain device category is relatively easy to identify... The risk is lower if a particular type of equipment has a higher security risk. High; Based on the comparison results of liquefied gas equipment for each equipment category, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specifications.
2. The image processing method of claim 1, wherein, Before obtaining the trained device recognition model, the method further includes: Obtain the device recognition model to be trained and sample device images; Based on the preset security check configuration information, the sample device image is labeled to obtain the image label of the sample device image; A training set is constructed based on the sample device images and the corresponding image labels; The device recognition model to be trained is trained based on the training set to obtain the trained device recognition model.
3. The image processing method of claim 2, wherein, The step of annotating the sample device image based on the preset security check configuration information to obtain the image tag for the sample device image includes: Based on the preset security inspection configuration information, the target device, its device category, and image coordinates are determined in each sample device image; Based on the device category and image coordinates of each target device in the sample device image, the image label of the sample device image is determined.
4. The image processing method of claim 2, wherein, The step of training the device recognition model to be trained based on the training set to obtain the trained device recognition model includes: The training set is provided to the device recognition model to be trained for recognition processing to obtain the recognition result of the training set; The loss value of the recognition result is calculated based on a preset loss function; With minimizing the loss value as the optimization objective, the parameters of the device recognition model to be trained are adjusted using the backpropagation algorithm. The parameter adjustment process is iterated until the loss value converges at the minimum or the number of iterations reaches a preset value, at which point training stops, and the trained device recognition model is obtained.
5. The image processing method as described in claim 4, characterized in that, The parameters of the device recognition model to be trained include basic parameters and enhancement parameters. The basic parameters are used to adjust the learning strategy during the training process, and the enhancement parameters are used to adjust the image parameters of the sample device images in the training set.
6. The image processing method as described in claim 1, characterized in that, The comparison results of liquefied gas equipment based on each equipment category determine whether the image of the equipment to be inspected meets the security inspection shooting specifications, including: If the comparison results for all types of liquefied gas equipment show that the identification confidence level is greater than the preset confidence level threshold, then the image of the equipment to be inspected is determined to meet the security inspection shooting specifications. If the identification confidence level of any type of liquefied gas equipment is not greater than the preset confidence level threshold, then the image of the equipment to be inspected is determined to be inconsistent with the security inspection shooting specifications.
7. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire images of the equipment to be inspected and a trained equipment recognition model. The equipment image includes at least one liquefied gas device, and the trained equipment recognition model is trained based on preset security configuration information. The recognition module is used to process the equipment image based on the trained equipment recognition model to obtain the recognition result of at least one of the liquefied gas devices in the equipment image; The determination module is used to determine whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the identification result of the liquefied gas equipment; The determining module includes: The first comparison submodule is used to compare the identification confidence of each type of liquefied gas equipment with a preset confidence threshold to obtain the comparison result of each type of liquefied gas equipment. Each device category corresponds to a preset confidence threshold. The preset confidence thresholds for different device categories may be the same or different. When the device category is a general-purpose device, its identification is clear and the false judgment rate is low, that is, the identification difficulty is low, so the corresponding confidence threshold is set higher. Conversely, when the device category is a device with a complex shape and easy confusion, that is, the identification difficulty is high, so the corresponding confidence threshold is set lower. For equipment categories involving high safety risks, the aforementioned confidence threshold is set higher; for equipment categories involving low safety risks, the aforementioned confidence threshold is set lower. The equipment categories involving high safety risks include alarms and pressure regulating valves, while the equipment categories involving low safety risks include wall brackets. The confidence threshold mentioned above is specifically calculated using the following formula: in, Let represent the confidence threshold for the i-th device category. This is represented as the minimum confidence threshold. This represents the maximum confidence threshold. The range of values between the minimum confidence threshold and the maximum confidence threshold is the range of confidence threshold values. Represented as a weighting factor, its value ranges from [0,1], and it is used to adjust the influence ratio of "identification difficulty" and "security risk". This represents the recognition difficulty weight for the i-th device category; a larger value indicates greater difficulty in recognition. This represents the security risk weight for the i-th device category; a larger value indicates a higher security risk. If a certain device category is relatively easy to identify... The risk is lower if a particular type of equipment has a higher security risk. High; The third determination submodule is used to determine whether the image of the equipment to be inspected conforms to the security inspection shooting specifications based on the comparison results of the liquefied gas equipment of each equipment category. 8.A computer device, comprising a memory, a processor, and computer readable instructions stored on the memory and running on the processor, wherein, When the processor executes the computer-readable instructions, it implements the image processing method as described in any one of claims 1 to 6.
9. A readable storage medium, having stored thereon computer readable instructions, characterized in that, When the computer-readable instructions are executed by a processor, they implement the image processing method as described in any one of claims 1 to 6.