Vehicle air conditioner parameter determination method and device, equipment and storage medium
By using ShuffleNetV2 network and YOLOv5s target detection model in new energy vehicles to extract occupant attributes and clothing information, and adjusting air conditioning parameters in combination with temperature data, the problem of difficulty in improving the thermal comfort of the passenger compartment in the existing technology is solved, and more efficient air conditioning parameter settings and a more comfortable riding environment are achieved.
Patent Information
- Application Number
- CN202510028415.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-03-21
AI Technical Summary
It is difficult for the existing technology to effectively use artificial intelligence technology to improve the thermal comfort of new energy vehicle passenger compartments.
By obtaining the image and temperature data of the occupants in the vehicle, the images are input to the ShuffleNetV2 network as the backbone network of the YOLOv5s target detection model, the occupant attributes and clothing category information are extracted, and the temperature data is input to the air conditioner parameter prediction model, and the air conditioner parameters are adjusted to improve thermal comfort.
It improves the accuracy and real-timeness of vehicle air conditioning parameters and improves the thermal comfort of the passenger compartment.
Smart Images

Figure CN119659254A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle air conditioning, and in particular to a method, device, equipment and storage medium for determining vehicle air conditioning parameters. Background Art
[0002] In recent years, new energy vehicles have developed rapidly, and their market share has been increasing day by day. Although my country is a major country in new energy vehicles, there is relatively little research on the intelligent thermal comfort air conditioning system of the passenger cabin itself. With the continuous development of science and technology, the concept of intelligent cockpit has been repeatedly mentioned, and the demand of drivers and passengers for automobile intelligence is also increasing day by day, which includes intelligent thermal comfort air conditioning system. Research on personalized and intelligent thermal comfort air conditioning system for passenger cabins of new energy vehicles is of great significance to promote the innovation and development of intelligent cockpit technology and realize the intelligence of the whole vehicle, providing a more comfortable and personalized driving experience for future intelligent vehicles.
[0003] With the development of computer hardware resources, artificial intelligence technology has undergone tremendous changes in the past decade and has been continuously integrated into people's daily lives. How to use artificial intelligence technology to improve the thermal comfort of the passenger compartment of new energy vehicles is an urgent problem to be solved in this field. Summary of the invention
[0004] The present application provides a method, device, equipment and storage medium for determining vehicle air-conditioning parameters. The method can improve the accuracy and real-time performance of vehicle air-conditioning parameter settings and enhance the thermal comfort of the vehicle passenger compartment.
[0005] The technical solution of this application is implemented as follows:
[0006] An embodiment of the present application provides a method for determining vehicle air-conditioning parameters, including: obtaining a first image of an occupant in a vehicle and temperature data collected by a vehicle sensor; inputting the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network to obtain attribute category information and clothing category information of the occupant in the vehicle; the ShuffleNetV2 network is used to extract features from the first image; inputting the attribute category information, clothing category information and temperature data into a target air-conditioning parameter prediction model to obtain target setting parameters of the air-conditioning, so as to adjust the current parameters of the air-conditioning based on the target setting parameters.
[0007] According to the above technical means, since the ShuffleNetV2 network is a lightweight network, the ShuffleNetV2 network is used as the backbone network of the YOLOv5s target detection model, so that the YOLOv5s target detection model can ensure the accuracy of vehicle occupant feature detection while also having a faster detection speed, thereby improving the accurate speed of vehicle occupant feature recognition, so that when the air-conditioning parameters are subsequently predicted based on the target detection results of the YOLOv5s target detection model, the accuracy and real-time performance of the air-conditioning parameter settings can be improved, thereby improving the thermal comfort of the vehicle passenger compartment.
[0008] Furthermore, the YOLOv5s target detection model also includes a category prediction module;
[0009] The first image is input into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network to obtain attribute category information and clothing category information of the occupants in the vehicle, including: using the ShuffleNetV2 network to extract features of the first image to obtain target image feature information; inputting the target image feature information into a value category prediction model to obtain attribute category information and clothing category information of the occupants in the vehicle.
[0010] According to the above technical means, by inputting the first image into ShuffleNetV2, it is possible to quickly extract the features of the attribute category and clothing category information in the first image, thereby obtaining the feature information of the target image, and further analyzing the feature information of the target image based on the category prediction model, so as to determine the attribute category information and clothing category information corresponding to the occupants in the vehicle.
[0011] Furthermore, the ShuffleNetV2 network includes three super-marking attention mechanism STA modules and three Stage modules. The STA modules and the Stage modules are connected alternately, and the first STA module is connected after the first Stage module.
[0012] The ShuffleNetV2 network is used to extract features from the first image to obtain feature information of the target image, including: inputting the initial image feature matrix corresponding to the first image into the first Stage module, passing through the first STA module, and outputting the first image feature matrix from the first STA module; the initial image feature matrix is a feature matrix obtained after preprocessing the first image; the first image feature matrix is input into the second Stage module, passing through the second STA module, and outputting the second image feature matrix from the second STA module; the second image feature matrix is input into the third Stage module, passing through the third STA module, and outputting the third image feature matrix from the third STA module; the scale parameters of the first image feature matrix, the second image feature matrix, and the third image feature matrix are all different; based on the first image feature matrix, the second image feature matrix, and the third image feature matrix, the feature information of the target image is determined.
[0013] According to the above technical means, through the alternating processing of the three STA modules and the three Stage modules of the ShuffleNetV2 network, the initial image matrix can be processed by convolution, normalization, matrix dimension transformation, etc., thereby improving the YOLOv5s target detection model's ability to capture effective features and improve the accuracy of target detection.
[0014] Further, each STA module includes a channel attention branch, a first spatial attention branch, and a second spatial attention branch;
[0015] The processing process of each STA module includes: obtaining the initial reference image feature matrix output by the Stage module before the STA module; inputting the initial reference image feature matrix into the channel attention branch to obtain the first reference image feature matrix; inputting the initial reference image feature matrix into the first spatial attention branch to obtain the second reference image feature matrix; and inputting the initial reference image feature matrix into the second spatial attention branch to obtain the third reference image feature matrix; based on the first reference image feature matrix, the second reference image feature matrix and the third reference image feature matrix, obtaining the target reference image feature matrix; the target reference image feature matrix is any one of the first image feature matrix, the second image feature matrix and the third image feature matrix.
[0016] According to the above technical means, the channel attention branch, the first spatial attention branch and the second spatial attention branch of the STA module can respectively perform feature extraction on the image feature matrix output by the Stage mechanism module, thereby capturing different image details and improving the accuracy of target detection.
[0017] Further, the channel attention branch includes a channel segmentation module, a first sub-channel attention branch, a second sub-channel attention branch, and a matrix fusion module; the first sub-channel attention branch includes an average pooling sub-module and a first weight determination sub-module; the second sub-channel attention branch includes a maximum pooling sub-module and a second weight determination sub-module;
[0018] The reference image feature matrix is input into the channel attention branch to obtain a first reference image feature matrix, including: inputting the initial reference image feature matrix into the channel segmentation module for channel segmentation processing to obtain a first initial reference image feature matrix and a second initial reference image feature matrix of the same dimension; inputting the first initial reference image feature matrix into the average pooling submodule, and passing through the average pooling submodule and the first weight determination submodule to obtain a first weight vector corresponding to the first initial reference image feature matrix; and inputting the second initial reference image feature matrix into the maximum pooling submodule, and passing through the maximum pooling submodule and the second weight determination submodule to obtain a second weight vector corresponding to the second initial reference image matrix; and inputting the first weight vector, the first initial reference image feature matrix, the second weight vector and the second initial reference image feature matrix into the matrix fusion module to obtain the first reference image feature matrix.
[0019] According to the above technical means, the first sub-channel attention branch and the second sub-channel attention branch of the channel attention branch can be used to obtain the weight vectors corresponding to the different image feature matrices after channel segmentation. Further, based on the matrix fusion module, feature extraction and fusion processing can be performed based on the weight vectors and the image feature matrix after channel segmentation, so that the final first reference image feature matrix can contain more image feature details.
[0020] Further, the first spatial attention branch includes a first matrix dimension transformation submodule, a first channel pooling submodule, a first image encoding submodule, a first normalization submodule, and a first matrix dimension inverse transformation submodule;
[0021] The initial reference image feature matrix is input into the first spatial attention branch to obtain a second reference image feature matrix, including: inputting the initial reference image feature matrix into the first matrix dimension transformation module for first dimension transformation processing to obtain a third initial reference image feature matrix; inputting the third initial reference image feature matrix into the first channel pooling submodule, sequentially passing through the first channel pooling submodule, the first image encoding submodule and the first normalization submodule to obtain a third weight matrix; inputting the third weight matrix and the third initial reference image feature matrix into the first matrix dimension inverse transformation submodule to obtain a second reference image feature matrix.
[0022] According to the above technical means, the initial reference image matrix is subjected to feature extraction through the first spatial attention branch. The feature extraction method is different from the feature extraction method in the channel attention branch. Image feature extraction from different angles can be achieved, thereby obtaining more image detail features and improving the accuracy of target detection.
[0023] Further, the second spatial attention branch includes a second matrix dimension transformation submodule, a second channel pooling submodule, a second image encoding submodule, a second normalization submodule, and a second matrix dimension inverse transformation submodule;
[0024] The initial reference image feature matrix is input into the second spatial attention branch to obtain a third reference image feature matrix, including: inputting the initial reference image feature matrix into the second matrix dimension transformation submodule for second dimension transformation processing to obtain a fourth initial reference image feature matrix; inputting the fourth initial reference image feature matrix into the second channel pooling submodule, sequentially passing through the second channel pooling submodule, the second image encoding submodule and the second normalization submodule to obtain a fourth weight matrix; inputting the fourth weight matrix and the fourth initial reference image feature matrix into the second matrix dimension inverse transformation submodule to determine the third reference image feature matrix.
[0025] According to the above technical means, the initial reference image matrix is subjected to dimensional transformation, pooling, image encoding and other processing through the second spatial attention branch, so that different detail features can be extracted, so that the final third reference image feature matrix contains more image features, thereby improving the accuracy of target detection and recognition.
[0026] Furthermore, the ShuffleNetV2 network also includes a Mosaic module, a convolution-batch normalization-activation function CBS module and a maximum pooling module. The method for preprocessing the first image includes: using the Mosaic module to perform data enhancement processing on the first image to obtain a second image; inputting the second image into the CBS module to obtain an image feature matrix corresponding to the second image; using the maximum pooling module to downsample the image feature matrix corresponding to the second image to obtain an initial image feature matrix corresponding to the first image.
[0027] According to the above technical means, by preprocessing the first image through the Mosaic module, the CBS module and the maximum pooling module, richer image features and an initial image feature matrix with a smaller scale or dimension can be obtained, so as to facilitate subsequent processing using the Stage module before the STA module.
[0028] Furthermore, the training process of the YOLOv5s target detection model includes: obtaining an image training set, the image training set including multiple image samples and sample attribute categories corresponding to each image sample, and sample clothing categories; inputting the multiple image samples into the initial YOLOv5s target detection model to obtain reference attribute categories and reference clothing categories corresponding to each image sample; based on the difference between the reference attribute category and the corresponding sample attribute category, and the difference between the reference clothing category and the sample clothing category, performing back propagation training on the initial YOLOv5s target detection model until the convergence condition is met, thereby obtaining a trained YOLOv5s target detection model.
[0029] According to the above technical means, the initial YOLOv5s target detection model is continuously trained according to the difference between the reference attribute category predicted by the initial YOLOv5s target detection model and the corresponding sample attribute category, as well as the difference between the reference clothing category predicted by the initial YOLOv5s target detection model and the sample clothing category, so that the results predicted by the YOLOv5s target detection model can be closer to the actual attribute category and clothing category, thereby improving the recognition accuracy of the trained YOLOv5s target detection model.
[0030] Furthermore, the method for determining vehicle air-conditioning parameters also includes: obtaining user attribute category samples, clothing category samples, temperature data samples, and feedback information on the user's preference for air-conditioning parameter settings; based on the category samples, clothing categories, temperature data samples and feedback information, training an initial air-conditioning parameter prediction model to obtain a target air-conditioning parameter prediction model; the initial air-conditioning parameter prediction model is an untrained air-conditioning parameter prediction model.
[0031] According to the above-mentioned technical means, the air-conditioning parameter prediction model is trained by utilizing the user's attribute category samples, clothing category samples, temperature data samples, and the user's feedback information on the parameter setting preferences of the air-conditioning. This can make the prediction results of the target air-conditioning parameter prediction model finally obtained closer to the user's setting preferences, thereby improving the accuracy of the predicted air-conditioning parameters.
[0032] The embodiment of the present application provides a device for determining vehicle air conditioning parameters, including:
[0033] A first acquisition module, used to acquire a first image of an occupant in the vehicle and temperature data collected by a vehicle sensor;
[0034] The first information determination module is used to input the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, to obtain attribute category information and clothing category information of the occupants in the vehicle; the ShuffleNetV2 network is used to extract features from the first image;
[0035] The first parameter determination module is used to input the attribute category information, clothing category information and temperature data into the target air conditioning parameter prediction model to obtain the target setting parameters of the air conditioner, so as to adjust the current parameters of the air conditioner based on the target setting parameters.
[0036] The embodiment of the present application provides a device for determining vehicle air conditioning parameters, including:
[0037] A memory for storing instructions for determining vehicle air conditioning parameters;
[0038] The processor is used to implement the method provided in the embodiment of the present application when executing the executable vehicle air-conditioning parameter determination instruction stored in the memory.
[0039] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are configured to execute the above-mentioned method for determining vehicle air-conditioning parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flow chart of a method for determining vehicle air conditioning parameters provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a method for setting parameters of an intelligent air conditioner with target detection and adaptive learning provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the structure of a backbone network of a YOLOv5s detection algorithm provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of a ShuffleNetV2 network provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of the structure of a STA module provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the structure of a device for determining vehicle air conditioning parameters provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the composition structure of a vehicle air conditioning parameter determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0048] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0049] In the following description, reference is made to “some embodiments\other embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments\other embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0050] In the following description, the terms "first\second\third\fourth" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third\fourth" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0052] Based on the problems existing in the related art, the embodiment of the present application provides a method for determining vehicle air conditioning parameters, which can improve the accuracy and rationality of vehicle air conditioning parameter settings and enhance the thermal comfort of the vehicle passenger compartment. Figure 1 FIG. 1 is a flow chart of a method for determining vehicle air conditioning parameters provided by an embodiment of the present application, the method comprising the following steps:
[0053] S101 : Acquire a first image of an occupant in a vehicle and temperature data collected by a vehicle sensor.
[0054] It should be noted that the vehicle can be a new energy vehicle or an electric vehicle, and the occupants in the vehicle can be a driver, a front passenger, a rear passenger, etc.; the first image can be an image of the occupants in the vehicle captured in real time by an image acquisition device of the door; the vehicle sensor can be a temperature sensor, and the temperature data can include the temperature inside the vehicle captured by the temperature sensor, or the door temperature and the temperature outside the vehicle.
[0055] In some embodiments, the first image may include information such as the face and clothing of the vehicle occupants. The first image of the vehicle occupants may be a captured image of the driver, an image of the front passenger, or an image of the rear passenger. Both the first image and the temperature data may be acquired in real time, and may be acquired at the same time, or may be acquired within a preset time period, such as within 2 seconds or 5 seconds.
[0056] S102, inputting the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, and obtaining attribute category information and clothing category information of the occupants in the vehicle.
[0057] In some embodiments, the ShuffleNetV2 network is used to extract features from the first image. The ShuffleNetV2 network is a lightweight convolutional neural network, which is mainly used for computer vision tasks such as target detection. YOLOv5s is the network with the smallest network depth and the smallest feature map width in the YOLOv5 (You Only Look Once version 5) model series. It has a fast detection speed and low requirements for hardware devices. The lightweight YOLOv5s target detection model can be obtained by replacing the backbone network of the YOLOv5s target detection model, the Cross Stage Partial Networks Darknet53 (CSPDarknet53), with the ShuffleNetV2 network. By inputting the first image into the YOLOv5s target detection model, image data enhancement, calculation of adaptive anchor frames, and image convolution, pooling and other processes can be performed to achieve feature extraction of the first image.
[0058] In some embodiments, the attribute category information of the occupants in the vehicle may include the gender, age and other information of the occupants in the vehicle. For example, the attribute categories corresponding to gender may include male and female, and the attribute categories corresponding to age may include infants, teenagers, young people, middle-aged people, and the elderly, etc.; clothing category information may include spring clothes, summer clothes, autumn clothes, and winter clothes, etc.
[0059] In some embodiments, the features of the occupants in the input first image can be identified by the YOLOv5s target detection model, and classification processing can be performed based on the identified features, so as to obtain the gender attribute, age attribute, clothing attribute, etc. corresponding to the occupants. For example, by identifying the first image corresponding to the main driver, it is determined that he is a young man wearing summer clothes. Male and young can be used as the attribute categories of the driver, and summer clothes can be used as the clothing category of the driver.
[0060] S103: Input the attribute category information, clothing category information and temperature data into a target air-conditioning parameter prediction model to obtain target setting parameters of the air-conditioning, so as to adjust the current parameters of the air-conditioning based on the target setting parameters.
[0061] In some embodiments, the target air conditioning parameter prediction model may be a trained decision tree model, a random forest model, etc. The target setting parameters of the air conditioner may include information such as the temperature, air volume, and air outlet mode of the air conditioner.
[0062] In some embodiments, by inputting the attribute category information, clothing category information, and real-time collected temperature data of the vehicle occupants output based on the YOLOv5s target detection model into the target air-conditioning parameter prediction model, the target air-conditioning parameter prediction can analyze the input attribute category information, clothing category information, and temperature data to determine the air-conditioning setting parameters that the vehicle occupants may prefer, that is, the target setting parameters, and then adjust the current parameters of the air-conditioning based on the target setting parameters.
[0063] In some embodiments, if the current parameters of the air conditioner are different from the target setting parameters, the current parameters can be adjusted to the target setting parameters; if the current parameters of the air conditioner are the same as the target setting parameters, the current parameters of the air conditioner can be kept unchanged.
[0064] In an embodiment of the present application, a first image of a vehicle occupant and temperature data collected by a vehicle sensor are obtained; the first image is input into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, and attribute category information and clothing category information of the vehicle occupant are obtained; the ShuffleNetV2 network is used to extract features from the first image; the attribute category information, clothing category information and temperature data are input into a target air conditioning parameter prediction model, and the target setting parameters of the air conditioning are obtained, so as to adjust the current parameters of the air conditioning based on the target setting parameters. In this way, since the ShuffleNetV2 network is a lightweight network, the ShuffleNetV2 network is used as the backbone network of the YOLOv5s target detection model, so that the YOLOv5s target detection model can ensure the accuracy of the vehicle occupant feature detection while also having a faster detection speed, thereby improving the accurate speed of the vehicle occupant feature recognition, so that when the air conditioning parameter prediction is performed based on the target detection result of the YOLOv5s target detection model, the accuracy and real-time performance of the air conditioning parameter setting can be improved, and the thermal comfort of the vehicle passenger compartment can be improved.
[0065] In some embodiments of the present application, the YOLOv5s target detection model also includes a category prediction module; based on this, the first image is input into the YOLOv5s target detection model whose backbone network is the ShuffleNetV2 network to obtain the attribute category information and clothing category information of the occupants in the vehicle, that is, the above-mentioned step S102 can be implemented by the following steps S1021 to S1022, and each step is described below.
[0066] S1021. Use the ShuffleNetV2 network to extract features of the first image to obtain feature information of the target image.
[0067] In some embodiments, the ShuffleNetV2 network can perform data enhancement, image scale transformation, convolution, pooling and other processing on the first image input thereto, and finally obtain the target image feature information. Among them, by performing data enhancement on the first image, multiple images smaller than the first image can be obtained, thereby enriching the image data and reducing the computational burden of the processor. By performing image scale transformation, convolution, pooling and other processing on the image obtained after data enhancement, the scale corresponding to the target image feature information outputted in the end (such as the width, height and number of channels of the feature matrix, etc.) can be matched with the input scale of the category prediction model.
[0068] S1022: Input the target image feature information into the category prediction model to obtain the attribute category information and clothing category information of the vehicle occupants.
[0069] In some embodiments, the category prediction model can analyze the input target image feature information to determine the gender, age group, and clothing category of the occupant in the vehicle corresponding to the current first image. If the age attribute category of the occupant in the vehicle includes two categories: male and female, the age category attribute includes five categories: infant, teenager, youth, middle-aged, and elderly, and the clothing includes four categories: spring clothing, summer clothing, autumn clothing, and winter clothing, then the comprehensive category to which the occupant in the vehicle belongs can include 40 categories, wherein the comprehensive category can be determined based on the attribute category information and the clothing category information, for example, male, teenager, and spring clothing are one category in the comprehensive category, and female, middle-aged, and summer clothing are one category in the comprehensive category.
[0070] In some embodiments, the category prediction model can predict the probability that the occupant in the vehicle corresponding to the first image belongs to different comprehensive categories, and determine the comprehensive category with the largest median value of each probability as the final target category, and the target category includes attribute category information and clothing category information. For example, if the comprehensive category determined based on the attribute category and clothing category includes 40 categories, the category prediction model can predict the probability corresponding to the occupant in the vehicle belonging to different categories, that is, a total of 40 probability values, among which, if the probability value of the third category is the largest, the category information corresponding to the third category can be determined as the target category.
[0071] It can be understood that by inputting the first image into ShuffleNetV2, it is possible to quickly extract the features of the attribute category and clothing category information in the first image, thereby obtaining the feature information of the target image, and further analyzing the feature information of the target image based on the category prediction model to determine the attribute category information and clothing category information corresponding to the occupants in the vehicle.
[0072] In some embodiments of the present application, the ShuffleNetV2 network includes three Super Token Attention (STA) modules and three Stage modules, the STA modules and the Stage modules are alternately connected, and the first STA module is connected after the first Stage module. The STA module and the three Stage structures are alternately connected in the following manner: the first Stage structure, the first STA module, the second Stage module, the second STA module, the third Stage module, and the third STA module. Based on this, the ShuffleNetV2 network is used to extract features of the first image to obtain feature information of the target image, that is, the above step A1021 can be implemented by the following steps S201 to S204, and each step is described below.
[0073] S201, inputting an initial image feature matrix corresponding to a first image into a first Stage module, passing through a first STA module, and outputting a first image feature matrix from the first STA module.
[0074] In some embodiments, the initial image feature matrix is a feature matrix obtained after preprocessing the first image. The preprocessing includes data enhancement, convolution, normalization, pooling and other processing, that is, in the ShuffleNetV2 network, other modules are included before the Stage module, which can be used to preprocess the first image to obtain the initial image feature matrix.
[0075] In some embodiments, the first Stage module can perform convolution, channel segmentation, normalization and other processing on the initial image feature matrix input thereto according to a preset step size, and input the processed image feature matrix into the three branches of the first STA module, perform matrix dimension transformation, pooling, convolution and other processing, and combine the image feature matrices obtained by the three branches to obtain the first image feature matrix. Among them, the preset compensation corresponding to the Stage module can be set arbitrarily, for example, the preset step size can be 1, 2, etc.
[0076] S202, input the first image feature matrix to a second Stage module, pass through a second STA module, and output a second image feature matrix from the second STA module.
[0077] In some embodiments, the second Stage module may be the same as the first Stage module, and the preset step length corresponding to the first Stage structure and the preset step length corresponding to the second Stage module may be the same or different. For example, the preset step length corresponding to the first Stage structure may be 1, and the preset step length corresponding to the second Stage module may be 2; the preset step length corresponding to the first Stage structure may be 2, and the preset step length corresponding to the second Stage structure may be 1; the preset step length corresponding to the first Stage structure and the preset step length corresponding to the second structure module may both be 1; the preset step length corresponding to the first Stage structure and the preset step length corresponding to the second structure module may both be 2.
[0078] In some embodiments, the second Stage module can perform convolution, channel segmentation, normalization and other processing on the first image feature matrix output by the first STA module, and input the processed image feature matrix into the first STA module for processing, thereby obtaining the first image feature matrix.
[0079] S203, input the second image feature matrix to a third Stage module, pass through a third STA module, and output a third image feature matrix from the third STA module.
[0080] In some embodiments, the scale parameters of the first image feature matrix, the second image feature matrix, and the third image feature matrix may be different. For example, if the dimension (width×height×number of channels) of the first image feature matrix is 52×52×128, the dimension of the first image feature matrix may be 26×26×256, and the dimension of the third image feature matrix may be 13×13×512.
[0081] In some embodiments, the third Stage module can perform convolution, channel segmentation, normalization and other processing on the second image feature matrix input thereto, and input the processed image feature matrix into the three branches of the third STA module for matrix dimension transformation, pooling, convolution and other processing, and combine the image feature matrices obtained from the three branches to obtain a third image feature matrix.
[0082] S204: Determine target image feature information based on the first image feature matrix, the second image feature matrix, and the third image feature matrix.
[0083] In some embodiments, the first image feature matrix, the second image feature matrix, and the third image feature matrix may be combined to obtain target image matrix information. In implementation, since the scales of the first image feature matrix, the second image feature matrix, and the third image feature matrix are different, the three image matrices may be directly determined as the target image feature matrix, or the dimensions of the three image feature matrices may be unified, for example, the image matrix with a small matrix dimension is expanded to be consistent with the dimension of the image matrix with the largest dimension among the three image matrices, and the expanded image feature matrix is used as the target image feature information. The method of determining the target image feature information based on the first image feature matrix, the second image feature matrix, and the third image feature matrix is merely an exemplary description, and this application does not limit this.
[0084] It can be understood that through the alternating processing of the three STA modules and the three Stage modules of the ShuffleNetV2 network, the initial image matrix can be processed by convolution, normalization, matrix dimension transformation, etc., thereby improving the YOLOv5s target detection model's ability to capture effective features and improve the accuracy of target detection.
[0085] In some embodiments of the present application, each STA module includes a channel attention branch, a first spatial attention branch, and a second spatial attention branch; the processing process of each STA module can be implemented through the following steps S301 to S303, and each step is described separately below.
[0086] S301, obtaining an initial reference image feature matrix output by a Stage module before a STA module.
[0087] In some embodiments, if the current STA module is the first STA module, the initial reference image feature matrix is the image feature matrix output by the first Stage module; if the current STA module is the second STA module, the initial reference image feature matrix is the image feature matrix output by the second Stage module; if the current STA module is the third STA module, the initial reference image feature matrix is the image feature matrix output by the third Stage module.
[0088] In some embodiments, the dimension of the reference image feature matrix output by the Stage module before the STA module may be 52×52×128, 26×26×256, or 13×13×512.
[0089] S302. Input the initial reference image feature matrix into the channel attention branch to obtain a first reference image feature matrix; input the initial reference image feature matrix into the first spatial attention branch to obtain a second reference image feature matrix; and input the initial reference image feature matrix into the second spatial attention branch to obtain a third reference image feature matrix.
[0090] In some embodiments, the initial image feature matrix can be input into the channel attention branch, the first spatial attention branch and the second spatial attention branch for processing respectively. The channel attention branch can divide the number of channels of the initial image feature matrix, and perform convolution, pooling, normalization and other processing on the image feature matrix obtained after the division, so as to obtain a first reference image feature matrix; the first spatial attention branch can perform dimensionality change processing on the initial image feature matrix, and perform pooling, convolution, normalization and other processing on the image feature matrix obtained after the dimensionality transformation processing, so as to obtain a second reference image feature matrix; the second spatial attention branch can also perform dimensionality transformation processing on the initial image feature matrix, and perform pooling, convolution and normalization processing on the image feature matrix obtained after the dimensionality transformation processing, so as to obtain a corresponding third reference image feature matrix.
[0091] In some embodiments, the dimensionality transformation processing in the first spatial attention branch is different from the dimensionality transformation processing in the second spatial attention branch. For example, the dimensionality transformation processing in the first spatial attention branch can be to transform width × height × number of channels into height × width × number of channels, and the dimensionality transformation processing in the first spatial attention branch can be to transform width × height × number of channels into number of channels × height × width.
[0092] S303 . Obtain a target reference image feature matrix based on the first reference image feature matrix, the second reference image feature matrix, and the third reference image feature matrix.
[0093] It should be noted that the target reference image feature matrix is any one of the first image feature matrix, the second image feature matrix and the third image feature matrix. If the current STA module is the first STA module, the target reference image feature matrix may be the first image feature matrix; if the current STA module is the second STA module, the target reference image matrix may be the second image feature matrix; if the current STA module is the third STA module, the target reference image matrix may be the third image feature matrix.
[0094] In some embodiments, the dimensions of the first reference image feature matrix, the second reference image feature matrix, and the third reference image feature matrix may be the same, and the first reference image feature matrix, the second image feature matrix, and the third image feature matrix may be combined or spliced to form a large target image feature matrix.
[0095] It can be understood that the channel attention branch, the first spatial attention branch and the second spatial attention branch of the STA module can respectively perform feature extraction on the image feature matrix output by the Stage mechanism module, thereby capturing different image details and improving the accuracy of target detection.
[0096] In some embodiments of the present application, the channel attention branch includes a channel segmentation module, a first sub-channel attention branch, a second sub-channel attention branch, and a matrix fusion module; the first sub-channel attention branch includes an average pooling sub-module and a first weight determination sub-module; the second sub-channel attention branch includes a maximum pooling sub-module and a second weight determination sub-module. Based on this, the "inputting the reference image feature matrix into the channel attention branch to obtain the first reference image feature matrix" in step S302 can be implemented by the following steps S401 to S403, and each step is described below.
[0097] S401 , inputting an initial reference image feature matrix into a channel segmentation module for channel segmentation processing to obtain a first initial reference image feature matrix and a second initial reference image feature matrix of the same dimension.
[0098] In some embodiments, the channel segmentation module may evenly divide the number of channels of the initial reference image matrix, thereby obtaining a first initial reference image feature matrix and a second initial reference image feature matrix having half the number of channels of the initial reference image feature matrix. For example, if the dimension of the initial image feature matrix is 52×52×128, the dimensions of the first initial reference image feature matrix and the second initial image feature matrix may both be 52×52×64.
[0099] S402, input the first initial reference image feature matrix into the average pooling submodule, and obtain the first weight vector corresponding to the first initial reference image feature matrix through the average pooling submodule and the first weight determination submodule; and input the second initial reference image feature matrix into the maximum pooling submodule, and obtain the second weight vector corresponding to the second initial reference image matrix through the maximum pooling submodule and the second weight determination submodule.
[0100] In some embodiments, the first weight determination submodule and the second weight determination submodule may be the same. Since the pooling in the first sub-channel attention branch is processed using average pooling and the pooling in the second sub-channel attention branch is processed using maximum pooling, the first sub-channel attention branch processes the first initial reference image feature matrix differently from the second sub-channel attention branch processes the second initial reference image feature matrix differently. The first weight vector and the second weight vector ultimately determined by the two branches are different, but the dimensions may be the same.
[0101] S403 , inputting the first weight vector, the first initial reference image feature matrix, the second weight vector, and the second initial reference image feature matrix into a matrix fusion module to obtain a first reference image feature matrix.
[0102] In some embodiments, the matrix fusion module may multiply the first weight vector and the first initial reference image feature matrix to obtain a first sub-reference image feature matrix, and multiply the second weight vector and the second initial reference image feature matrix to obtain a second sub-reference image feature matrix, and then combine the first sub-reference image feature matrix and the second sub-reference image feature matrix, for example, splicing the two image feature matrices, to obtain the first reference image feature matrix.
[0103] It can be understood that the first sub-channel attention branch and the second sub-channel attention branch of the channel attention branch can be used to obtain the weight vectors corresponding to the different image feature matrices after channel segmentation. Further, based on the matrix fusion module, feature extraction and fusion processing can be performed based on the weight vectors and the image feature matrix after channel segmentation, so that the final first reference image feature matrix can contain more image feature details.
[0104] In some embodiments of the present application, the first spatial attention branch includes a first matrix dimension transformation submodule, a first channel pooling submodule, a first image encoding submodule, a first normalization submodule, and a first matrix dimension inverse transformation submodule. Based on this, "inputting the initial reference image feature matrix into the first spatial attention branch to obtain a second reference image feature matrix" in step S302 can be implemented through the following steps S501 to S503, and each step is described below.
[0105] S501. Input an initial reference image feature matrix into a first matrix dimension transformation module for first dimension transformation processing to obtain a third initial reference image feature matrix.
[0106] In some embodiments, the first dimension change processing may be a transposition processing of the dimension of the initial reference image feature matrix, for example, transposing the width and height of the initial reference image feature matrix while keeping the dimension of the initial reference image feature matrix unchanged; the width and height of the third initial reference image feature matrix and the initial image feature matrix may be different, and the number of channels may be the same.
[0107] Exemplarily, if the dimension of the initial reference image feature matrix is 52×26×64, after the initial reference image feature matrix is subjected to a first dimension transformation process using the first matrix dimension transformation module, the dimension of the obtained third initial reference image feature matrix may be 26×52×64.
[0108] S502, input the third initial reference image feature matrix into the first channel pooling submodule, and sequentially pass through the first channel pooling submodule, the first image encoding submodule and the first normalization submodule to obtain a third weight matrix.
[0109] In some embodiments, the first channel pooling submodule may be a Z-direction pooling module Z-Pool, and Z-Pool may represent pooling in the third dimension (usually the number of channels) of the image matrix. Through the first channel pooling submodule, the third initial reference image feature matrix may be transformed into an image feature matrix with a preset number of channels, and the preset number of channels may be set arbitrarily. The first image encoding submodule may be a constant bit rate encoding (Constant Bit Rate, CBR), and the first normalization submodule may include a Sigmod function module. Through the first normalization submodule, the features in the image feature matrix output by the first image encoding submodule may be normalized to obtain a third weight matrix, and the values of the elements in the third weight matrix are all less than 1, thereby reducing the complexity of subsequent processing.
[0110] S503 , input the third weight matrix and the third initial reference image feature matrix into the first matrix dimension inverse transformation submodule to obtain a second reference image feature matrix.
[0111] In some embodiments, the first matrix dimension inverse transformation submodule can multiply the third weight matrix and the third initial image feature matrix to obtain a new image feature matrix, and then inversely transform the dimension of the new image feature matrix to obtain a second reference image feature matrix having the same dimension as the initial reference image feature matrix.
[0112] It can be understood that by performing feature extraction on the initial reference image matrix through the first spatial attention branch, the feature extraction method is different from the feature extraction method in the channel attention branch, and image feature extraction from different angles can be achieved, thereby obtaining more image detail features and improving the accuracy of target detection.
[0113] In some embodiments of the present application, the second spatial attention branch includes a second matrix dimension transformation submodule, a second channel pooling submodule, a second image encoding submodule, a second normalization submodule, and a second matrix dimension inverse transformation submodule; based on this, "inputting the initial reference image feature matrix into the second spatial attention branch to obtain a third reference image feature matrix" in step S302 can be implemented through the following steps S601 to S603, and each step is explained separately below.
[0114] S601. Input the initial reference image feature matrix into the second matrix dimension transformation submodule for second dimension transformation processing to obtain a fourth initial reference image feature matrix.
[0115] In some embodiments, the second dimensional transformation submodule and the first dimensional transformation submodule may be the same or different, and the first dimensional transformation processing and the second dimensional transformation processing may be different. The second dimensional transformation processing may be to transpose the width and number of channels corresponding to the initial reference image feature matrix while keeping the height unchanged, that is, to interchange the width and number of channels of the initial reference image matrix, thereby obtaining a fourth initial reference image feature matrix. For example, if the initial reference image feature matrix is 26×26×128, then after the second matrix dimension transformation submodule is used to perform the second dimensional transformation processing on the initial image feature matrix, the dimension of the fourth initial reference image feature matrix obtained may be 128×26×26.
[0116] S602: Input the fourth initial reference image feature matrix into the second channel pooling submodule, and sequentially pass through the second channel pooling submodule, the second image encoding submodule and the second normalization submodule to obtain a fourth weight matrix.
[0117] In some embodiments, the second channel pooling submodule may be the same as the first channel pooling submodule, for example, it may be a Z-Pool; the second image encoding submodule may be the same as the first image encoding submodule, for example, it may also be a CBR encoding module; the second normalization submodule may be the same as the first normalization submodule, for example, it may also include a Sigmod function module.
[0118] In some embodiments, the fourth initial reference image feature matrix can be transformed into an image feature matrix with a preset number of channels, and the preset number of channels can be set arbitrarily. The features in the image feature matrix output by the second image encoding submodule can be normalized by the second normalization submodule to obtain a fourth weight matrix, and the values of the elements in the fourth weight matrix are all less than 1.
[0119] S603: Input the fourth weight matrix and the fourth initial reference image feature matrix into the second matrix dimension inverse transformation submodule to determine the third reference image feature matrix.
[0120] In some embodiments, after the fourth weight matrix is determined, the fourth weight matrix and the fourth initial reference image feature matrix can be multiplied by the second matrix dimension inverse transformation submodule, and the dimension of the image feature matrix processed by the multiplication can be inversely transformed so that the dimension of the final third reference image feature matrix is the same as the dimension of the initial image feature matrix.
[0121] It can be understood that by performing dimensional transformation, pooling, image encoding and other processing on the initial reference image matrix through the second spatial attention branch, different detail features can be extracted, so that the final third reference image feature matrix contains more image features, thereby improving the accuracy of target detection and recognition.
[0122] In some embodiments of the present application, the ShuffleNetV2 network also includes a Mosaic module, a convolution-Batch Normalization-Sigmoid Gated Linear Unit (CBS) module and a maximum pooling module. Based on this, the preprocessing of the first image can be achieved through the following steps S701 to S703. Each step is described below.
[0123] S701. Perform data enhancement processing on the first image using a Mosaic module to obtain a second image.
[0124] In some embodiments, data enhancement processing may be performed on the first image by performing color transformation, geometric transformation, noise addition, etc., so as to obtain a second image with richer features. The second image may include multiple images, and the dimension of the second image may be higher than that of the first image.
[0125] S702: Input the second image into the CBS module to obtain an image feature matrix corresponding to the second image.
[0126] In some embodiments, the CBS module includes a convolution submodule CONV (convolution), a normalization submodule BN (Batch Normalization) and an activation function submodule (or nonlinear submodule) SILU (Sigmoid Linear Unit). The three modules can perform convolution, normalization and nonlinear processing on the input second image in sequence to adjust the number of channels of the image feature matrix and reduce its size, thereby obtaining an image feature matrix corresponding to the second image.
[0127] S703: Use a maximum pooling module to downsample the image feature matrix corresponding to the second image to obtain an initial image feature matrix corresponding to the first image.
[0128] In some embodiments, after the second image is processed using the CBS module to obtain an image feature matrix corresponding to the second image, the image matrix corresponding to the second image can be downsampled using a maximum pooling module to reduce the dimension of the image feature matrix to reduce the number of parameters, thereby obtaining a processed initial image feature matrix.
[0129] It can be understood that by preprocessing the first image through the Mosaic module, the CBS module and the maximum pooling module, richer image features and an initial image feature matrix with a smaller scale or dimension can be obtained, so as to facilitate subsequent processing using the Stage module before the STA module.
[0130] In some embodiments of the present application, the training method of the YOLOv5s target detection model can be implemented by the following steps S801 to S803, and each step is described below.
[0131] S801. Obtain an image training set.
[0132] It should be noted that the image training set includes multiple image samples and sample attribute categories corresponding to each image sample, as well as sample clothing categories. The image sample can be a pre-acquired photographed image of a person, which can be a photographed image of a passenger in a vehicle, a photographed image of a person outside a vehicle, or a photographed image of a person in other scenes (such as a shopping mall, a park, etc.), and the photographed image can include information such as a face and clothing. The sample attribute category can include the gender attribute category and the age attribute category of the person in the sample image, and the gender attribute category can include male and female, and the age attribute category can include infants, teenagers, youth, middle-aged and elderly. The sample clothing category can include the clothing category of the person in the image sample, for example, it can include spring clothing, summer clothing, autumn clothing and winter clothing.
[0133] In some embodiments, the image training set can be obtained from a database or from a local storage area. Each image sample in the image training set corresponds to a sample attribute category and a sample clothing category. The sample attribute categories and sample clothing categories corresponding to different image samples may be the same or different.
[0134] S802: Input multiple image samples into the initial YOLOv5s target detection model to obtain reference attribute categories and reference clothing categories corresponding to each image sample.
[0135] In some embodiments, the initial YOLOv5s target detection model may be an untrained YOLOv5s target detection model, and the reference attribute category and reference clothing category may be attribute categories and clothing categories corresponding to persons in the image sample predicted by the initial YOLOv5s target detection model. The reference attribute category and the sample attribute category may be the same or different, and the reference clothing category and the sample clothing category may be the same or different.
[0136] S803. Based on the difference between the reference attribute category and the corresponding sample attribute category, and the difference between the reference clothing category and the sample clothing category, the initial YOLOv5s target detection model is back-propagated and trained until the convergence condition is met, thereby obtaining a trained YOLOv5s target detection model.
[0137] In some embodiments, the number of differences between the reference attribute categories and the sample attribute categories, as well as the number of differences between the reference clothing categories and the sample clothing categories can be determined, and the first prediction error rate of the initial YOLOv5s target detection model for the attribute categories is further determined based on the number of differences between the reference attribute categories and the sample attribute categories and the total number of image samples, and the second prediction error rate of the initial YOLOv5s target detection model for the clothing categories is determined based on the number of differences between the reference clothing categories and the sample clothing categories and the total number of image samples, and whether to stop training the YOLOv5s target detection model is determined based on the first prediction error rate and the second prediction error rate.
[0138] In some embodiments, the convergence condition may be that the first prediction error rate is less than the first threshold, and the second prediction error rate is less than the second threshold, or the first prediction error rate and the second prediction error rate are less than the third threshold. When the convergence condition is met according to the first prediction error rate and the second prediction error rate, the training process can be terminated to obtain a trained YOLOv5s target detection model.
[0139] It can be understood that, according to the difference between the reference attribute category predicted by the initial YOLOv5s target detection model and the corresponding sample attribute category, as well as the difference between the reference clothing category predicted by the initial YOLOv5s target detection model and the sample clothing category, continuous training of the initial YOLOv5s target detection model can make the results predicted by the YOLOv5s target detection model closer to the actual attribute category and clothing category, thereby improving the recognition accuracy of the trained YOLOv5s target detection model.
[0140] In some embodiments of the present application, the target air-conditioning parameter prediction model may be a trained air-conditioning parameter prediction, and the air-conditioning parameter prediction model may be implemented through the following steps S901 to S902, each of which is described below.
[0141] S901. Obtaining a user's attribute category samples, clothing categories, temperature data samples, and feedback information on the user's preference for parameter settings of an air conditioner.
[0142] It should be noted that the user's attribute category samples may include the predetermined user's gender category and age group category, the clothing category may include whether the user is wearing spring, summer, autumn or winter clothes, the user may be a passenger in a vehicle, the temperature data samples may include the temperature inside the vehicle and the temperature outside the vehicle, and the user's feedback information on the air conditioning parameter setting preferences may include the air conditioning parameters set by the user's preferences, for example, the user is accustomed to adjusting the air conditioning air volume to the lowest level in winter, etc.
[0143] In some embodiments, the user's attribute category samples, clothing categories, temperature data samples, and the user's feedback information on the parameter setting preferences of the air conditioner can be predetermined or obtained during the current vehicle use process. The user's attribute category samples, clothing categories, and temperature data samples can include multiple categories, and the user's feedback information on the parameter setting preferences of the air conditioner can also include multiple categories.
[0144] S902: Based on the category samples, clothing categories, temperature data samples and feedback information, an initial air-conditioning parameter prediction model is trained to obtain a target air-conditioning parameter prediction model.
[0145] In some embodiments, the initial air conditioning parameter prediction model may be untrained or pre-trained. The air conditioning parameter prediction model may be a decision tree model or a random forest model. Category samples, clothing categories, and temperature data samples may be input into the initial air conditioning parameter prediction model to predict corresponding air conditioning setting parameters. Based on the difference between the air conditioning setting parameters and the feedback information of the user's preference for the air conditioning parameter settings, the parameters of the initial air conditioning parameter prediction model may be adjusted to obtain a target air conditioning parameter prediction model.
[0146] It can be understood that by training the air-conditioning parameter prediction model using the user's attribute category samples, clothing category samples, temperature data samples, and the user's feedback information on the parameter setting preferences for the air-conditioning, the prediction results of the target air-conditioning parameter prediction model can be closer to the user's setting preferences, thereby improving the accuracy of the predicted air-conditioning parameters.
[0147] In an embodiment of the present application, a first image of a vehicle occupant and temperature data collected by a vehicle sensor are obtained; the first image is input into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, and attribute category information and clothing category information of the vehicle occupant are obtained; the ShuffleNetV2 network is used to extract features from the first image; the attribute category information, clothing category information and temperature data are input into a target air conditioning parameter prediction model, and the target setting parameters of the air conditioning are obtained, so as to adjust the current parameters of the air conditioning based on the target setting parameters. In this way, since the ShuffleNetV2 network is a lightweight network, the ShuffleNetV2 network is used as the backbone network of the YOLOv5s target detection model, so that the YOLOv5s target detection model can ensure the accuracy of the vehicle occupant feature detection while also having a faster detection speed, thereby improving the accurate speed of the vehicle occupant feature recognition, so that when the air conditioning parameter prediction is performed based on the target detection result of the YOLOv5s target detection model, the accuracy and real-time performance of the air conditioning parameter setting can be improved, and the thermal comfort of the vehicle passenger compartment can be improved.
[0148] Next, the implementation process of the application embodiment in the actual application scenario is introduced.
[0149] Figure 2 A flowchart of a method for setting intelligent air-conditioning parameters by target detection and adaptive learning is provided in an embodiment of the present application. The method can be implemented by the following steps S11 to S13, and each step is described separately below.
[0150] S11. The target detection model detects and identifies the image of the occupant (equivalent to the "first image" in other embodiments) to obtain the occupant's features (equivalent to the "attribute category information and clothing category information" in other embodiments).
[0151] In some embodiments, the occupant characteristics may include the occupant's gender, age, and clothing characteristics. The vehicle system will obtain the interior of the passenger compartment through the vehicle camera and upload the video to the cloud server, and detect and identify the user's portrait through the target detection model deployed on the cloud server. The cloud server can identify the gender, age, and clothing characteristics of each occupant.
[0152] In some embodiments, during the process of detecting and identifying the image of the occupant by the target detection model, the image of the occupant is first segmented by frame, and these pictures are normalized to obtain an image. The face coordinate frame and the upper body clothing coordinate frame in the image are detected by the target detection model, and then the image content in these coordinate frames is identified and classified to determine the user's age, gender, and clothing.
[0153] In some embodiments, the target detection model can be based on YOLOv5s. The purpose of target detection is to detect all passengers in the cockpit video captured by the camera, and YOLOv5s, which performs well in real-time and accuracy, is used as the basic framework. Figure 3 As shown in the figure, the backbone network Backbone 20 of the YOLOv5s detection algorithm consists of Focus 21, CBS22 and Spatial Pyramid Pooling (SPP) 23. Its network layers are deep and the model parameters are large. In order to ensure the detection accuracy while having fewer model parameters and faster detection speed, this paper introduces the lightweight ShuffleNetV2 network as the Backbone of YOLOv5s. In order to compensate for the accuracy loss caused by the lightweight model, the STA attention mechanism is added after the Stage structure in the ShuffleNetV2 network to improve the model's ability to capture effective features.
[0154] In some embodiments, the structure of the ShuffleNetV2 network is as follows: Figure 4As shown, the ShuffleNetV2 network 30 includes an input module Input31, a CSB module 32, a maximum pooling module Max Pool 33, and three groups of alternately connected Stage modules 34 and STA modules 35. The processing process of the ShuffleNetV2 network 30 includes: first, the input image size is adjusted to 640×640, and normalized so that the image data has a mean of 0 and a standard deviation of 1. Then the input image is enhanced by Mosaic data to enrich the data set and reduce the burden on the GPU. Subsequently, the aspect ratio of the input image is processed by adaptive anchor frame calculation and adaptive image scaling to improve the inference speed. The input image is first processed by the CBS module 32 (convolution Conv, batch normalization BN, activation function SiLU) to adjust the number of channels of the feature matrix and reduce the size; then it is downsampled by the maximum pooling (Maxpool) operation to reduce the number of parameters; finally, the Stage module 34 and the STA module 35 are processed alternately 3 times to output features of different sizes. In order to make the output feature dimension of Backbone match the neck network Neck, the embodiment of the present application adjusts the number of output channels of the CBS module 32, the three Stage modules 34 and other structures to 64, 128, 256 and 512 respectively.
[0155] In some embodiments, when the stride in the Stage module 34 takes different values, the Stage module 34 also changes accordingly. Figure 4 As shown, when stride=1, the left branch in the Stage module 34 is not processed in any way, and the right branch is processed by CBR (convolution Conv, batch normalization BN, activation function ReLU) 34a, DW Conv (depth-separable convolution) 34b and CBR 34c in sequence, and the output result of the left branch is connected with the output result of the right branch through Concat 34d; when stride=2, the left branch in the Stage module 34 will first be processed by DW Conv 34b and CBR 34a in sequence, and the right branch will be processed by CBR 34a, DW Conv 34b and CBR 34c in sequence, and the output result of the left branch will be Concat 34d and Channel Shuffle 34e with the output result of the right branch.
[0156] In some embodiments, as the number of network layers continues to increase, the image resolution continues to decrease in the process of Backbone continuously convolving the input image to extract features, resulting in the loss of feature information of small target objects with lower resolution in the image, resulting in low detection accuracy. In order to effectively improve this problem, the channel-spatial attention (ShuffleAttention Network, SA-Net) is combined with the cross-channel attention Triplet, the spatial attention of SA-Net and the channel attention of Triplet are improved, and a cross-channel-spatial attention module STA is proposed to effectively capture the feature mapping relationship between different dimensions and improve the detection accuracy of the model without increasing the computational overhead. This application introduces the STA module 35 in Backbone.
[0157] like Figure 5 The figure shows a schematic diagram of the structure of a STA module provided by the present application. The STA module 35 is divided into three branches:
[0158] The first branch is the channel attention branch. The input feature C×H×W is first divided equally by the number of channels of the input feature through a split operation 35a to obtain two sets of feature matrices C / 2×H×W. Then, the input feature C×H×W is converted to 1×H×W through mean pooling 35b and maximum pooling 35c (equivalent to the maximum pooling module 33). Then, the weights are generated through F(x) 35d and Sigmoid activation function 35e respectively. The weights are then multiplied by the feature matrix C / 2×H×W at the element level through an element-wise product operation 35f. Finally, the output feature C×H×W of the first branch is obtained through a Concat operation 35g and a Channel Shuffle operation 35h.
[0159] The second branch is the spatial attention branch, where the channel C dimension and the spatial W dimension interact to process feature information. The input feature C×H×W is first transformed into H×C×W by a permutation operation 35i, and then transformed into 2×C×W by a Z-Pool operation 35j, and then transformed into 1×C×W by a CBR 34c process, and then a weight is generated by a Sigmoid activation function 35e. Finally, the weight is subjected to an Element-wise product operation 35f with the input feature H×C×W, and the output feature C×H×W of the second branch is obtained by a Permute operation 35i.
[0160] The third branch is also a spatial attention branch. The channel C dimension and the spatial H dimension interact to process feature information. The input feature C×H×W is first converted to W×H×C through the Permute operation 35i, and then converted to 2×H×C through the Z-Pool operation 35j. It is then processed by CBR 35k (equivalent to the CBR module 34c) to become 1×H×C, and then the weight is generated through the Sigmoid activation function 35e. Finally, the weight is Element-wise product operation 35f is performed on the input feature W×H×C, and the output feature C×H×W of the third branch is obtained through the Permute operation 35i. Figure 5 In the formula (1), F(x) represents the matrix multiplication and addition operations, which aims to enhance the expressive power of features and thus capture more effective feature information.
[0161] F(x)=wx+b (1);
[0162] Among them, w represents the weight matrix, x represents the image feature matrix, and b represents the bias vector.
[0163] In some embodiments, during the training of the target detection model, a loss function can be established. The loss function Loss of the YOLOv5 model can be composed of the classification loss L class , positioning loss L loc The weighted sum of the two parts can be expressed as formula (2):
[0164] Loss = l1L class +l2L loc (2);
[0165] Where λ1 and λ2 represent the balance coefficients, and their value range is [0, 1].
[0166] Classification loss L class can be expressed by formula (3):
[0167]
[0168] In the formula, O ij ∈{0,1}, indicating whether there is a j-th type of target in the i-th predicted target box; C i j is the predicted value, C ij The target probability obtained by the Sigmoid function; N pos is the number of positive samples.
[0169] Positioning loss Ll oc It can be expressed by formula (4):
[0170]
[0171] Where IoU represents the intersection over union ratio between the predicted box and the real box; r(b,b gt ) represents the Euclidean distance between the center coordinates of the predicted box and the real box; c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box; α is the weight parameter; v is the parameter for measuring the consistency of the aspect ratio; w gt 、h gt Represent the width and height of the real box respectively; w and h represent the width and height of the predicted box respectively.
[0172] S12. Input the occupant characteristics and sensor parameters (equivalent to the "temperature data" in other embodiments) into the decision model (equivalent to the "target air-conditioning parameter prediction model" in other embodiments), and output the air-conditioning setting parameters (equivalent to the "target setting parameters" in other embodiments).
[0173] In some embodiments, the gender, age, clothing characteristics and in-vehicle sensor parameters of each occupant are input into the decision model for prediction, and the deployed decision model is used for judgment, and finally outputs information such as the air conditioning setting temperature, air volume level and air outlet mode.
[0174] In some embodiments, the age, gender, and clothing output by the target detection model in S11 can be combined with the temperature inside the car, the temperature outside the car, and the user's preference settings or operating habits as the main feature input decision model. Here, the feature vector [A1, A2, ..., A n ] T Indicates that the candidate feature dataset About Feature A l The Gini index of (l=1,2,...,m) can be expressed by formula (5):
[0175]
[0176] Where x represents the feature vector corresponding to the x-th image, m represents the total number of features or elements in the feature vector, h represents the category corresponding to the feature vector, and l represents the specific feature. Formula (5) can also be expressed by formula (6):
[0177]
[0178] in, Representation characteristics In feature A l = the number of h, is the number of samples in the training set. The Gini index is used to select the optimal features and the optimal split point to construct a classification and regression tree (CART). Furthermore, the cyclic k-fold cross-validation method is used to adjust the parameters, and grid search is used to adjust other parameters. The principle of fold cross-validation is to first divide the original data set into k non-overlapping subsets of the same size, traverse these k subsets in turn, train and evaluate the model, and finally take the average of the k evaluation accuracy as the final evaluation indicator. Grid search is a method of systematically traversing a given parameter combination and evaluating the model performance through fold cross-validation to select the best parameter combination. The cross-validation function selected in this paper can be expressed by formula (6):
[0179] {p1,p2,2,p k = cvs(D x ,rf,k) (6);
[0180] Among them, D x is the training set, rf is the algorithm instance object, p k To evaluate the accuracy, k should be greater than or equal to the minimum number of all target categories. If the minimum number of categories is greater than 10, then 10 is selected. The multi-target random forest object can be expressed as formula (7):
[0181]
[0182] Among them, RF is the base class of random forest, MultiOutputClassifier is a multi-target classifier, and n_estimators is the estimated parameters, such as the number of decision trees. Through the formula, different numbers of decision trees are trained cyclically and the corresponding model accuracy is obtained, and then the number of decision trees corresponding to the highest accuracy is found: For the adjustment of other parameters, grid search is used in turn.
[0183] Finally, by establishing the CART decision tree, the passenger cabin personalized thermal comfort decision model GS under random forest is obtained, and its prediction formula can be expressed by formula (8):
[0184] D target =GS.predict(D input ) (8);
[0185] Among them, D input is the input eigenvalue, D targetis the decision target value, and GS is the established model object. Vehicles generate massive amounts of data in daily use, and these data are processed with big data technology to understand the user's setting preferences. First, the metadata of the vehicle is uploaded to the cloud, and the data is collected, cleaned and calculated in the cloud server. The developer calculates the user's setting preferences in different scenarios, such as the user's wind volume and wind mode preferences in different seasons, and assigns certain weights to these preferences, and inputs them into the decision forest model as feature factors, so that the output of the decision model is more in line with user preferences.
[0186] S13, sending the air conditioning setting parameters to the service-oriented software interface, so as to call the corresponding actuator through the service-oriented software interface to set the air conditioning parameters, and feed back the setting results to the central control screen.
[0187] In some embodiments, the air conditioning setting temperature, air volume level, and air outlet mode information can be output to the service software interface, and then the service software can be used to call various actuators. At the same time, this information is also transmitted to the central control screen to feedback to the user. Of course, users can also make adjustments based on their own preferences. The method can make real-time strategy adjustments based on user input to meet the thermal comfort of the passenger compartment. In addition, the method will also autonomously learn the user's preference settings, constantly adapt to the user's needs, and achieve better and more personalized passenger compartment thermal management.
[0188] The intelligent air-conditioning parameter setting method of target detection and adaptive learning provided in the present application uses a target detection model to perform target detection and recognition, and uses a decision model to predict air-conditioning parameters based on the output results of the target detection model. This can more accurately and intelligently determine the air-conditioning parameters preferred by the user and improve the thermal comfort of the passenger compartment of new energy vehicles.
[0189] The present application provides a device for determining vehicle air conditioning parameters. Figure 6 A schematic diagram of the structure of a vehicle air conditioning parameter determination device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the vehicle air conditioning parameter determination device 40 includes:
[0190] A first acquisition module 41, used to acquire a first image of an occupant in the vehicle and temperature data collected by a vehicle sensor;
[0191] A first information determination module 42 is used to input the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, to obtain attribute category information and clothing category information of the occupant in the vehicle; the ShuffleNetV2 network is used to perform feature extraction on the first image;
[0192] The first parameter determination module 43 is used to input the attribute category information, the clothing category information and the temperature data into the target air conditioning parameter prediction model to obtain the target setting parameters of the air conditioner so as to adjust the current parameters of the air conditioner based on the target setting parameters.
[0193] In some embodiments, the YOLOv5s target detection model further includes a category prediction module; the first information determination module 42 includes:
[0194] A first feature extraction submodule is used to extract features of the first image using the ShuffleNetV2 network to obtain target image feature information;
[0195] The first input submodule is used to input the target image feature information into the category prediction model to obtain the attribute category information and clothing category information of the occupant in the vehicle.
[0196] In some embodiments, the ShuffleNetV2 network includes three super-marking attention mechanism STA modules and three Stage modules, the STA modules and the Stage modules are alternately connected, and the first STA module is connected after the first Stage module; the first feature extraction submodule includes:
[0197] A first input unit is used to input an initial image feature matrix corresponding to the first image into the first Stage module, pass through the first STA module, and output the first image feature matrix from the first STA module; the initial image feature matrix is a feature matrix obtained after preprocessing the first image;
[0198] A second input unit, used for inputting the first image feature matrix into a second Stage module, passing through the second STA module, and outputting a second image feature matrix from the second STA module;
[0199] a third input unit, used for inputting the second image feature matrix into a third Stage module, passing through the third STA module, and outputting a third image feature matrix from the third STA module; the scale parameters of the first image feature matrix, the second image feature matrix, and the third image feature matrix are all different;
[0200] The first determining unit is used to determine the target image feature information based on the first image feature matrix, the second image feature matrix and the third image feature matrix.
[0201] In some embodiments, each STA module includes a channel attention branch, a first spatial attention branch, and a second spatial attention branch; the first input unit or the second input unit or the third input unit further includes:
[0202] A first acquisition subunit is used to acquire an initial reference image feature matrix output by a Stage module before the STA module;
[0203] A first input subunit is configured to input the initial reference image feature matrix into the channel attention branch to obtain a first reference image feature matrix; input the initial reference image feature matrix into the first spatial attention branch to obtain a second reference image feature matrix; and input the initial reference image feature matrix into the second spatial attention branch to obtain a third reference image feature matrix;
[0204] The first determination subunit obtains a target reference image feature matrix based on the first reference image feature matrix, the second reference image feature matrix and the third reference image feature matrix; the target reference image feature matrix is any one of the first image feature matrix, the second image feature matrix and the third image feature matrix.
[0205] In some embodiments, the channel attention branch includes a channel segmentation module, a first sub-channel attention branch, a second sub-channel attention branch, and a matrix fusion module; the first sub-channel attention branch includes an average pooling sub-module and a first weight determination sub-module; the second sub-channel attention branch includes a maximum pooling sub-module and a second weight determination sub-module; the first input sub-unit is further used to:
[0206] Inputting the initial reference image feature matrix into the channel segmentation module for channel segmentation processing to obtain a first initial reference image feature matrix and a second initial reference image feature matrix of the same dimension;
[0207] Inputting the first initial reference image feature matrix into the average pooling submodule, and passing through the average pooling submodule and the first weight determination submodule to obtain a first weight vector corresponding to the first initial reference image feature matrix; and inputting the second initial reference image feature matrix into the maximum pooling submodule, and passing through the maximum pooling submodule and the second weight determination submodule to obtain a second weight vector corresponding to the second initial reference image matrix;
[0208] The first weight vector, the first initial reference image feature matrix, the second weight vector and the second initial reference image feature matrix are input into the matrix fusion module to obtain the first reference image feature matrix.
[0209] In some embodiments, the first spatial attention branch includes a first matrix dimension transformation submodule, a first channel pooling submodule, a first image encoding submodule, a first normalization submodule, and a first matrix dimension inverse transformation submodule; the first input subunit is further used to:
[0210] Inputting the initial reference image feature matrix into the first matrix dimension transformation module for first dimension transformation processing to obtain a third initial reference image feature matrix;
[0211] Inputting the third initial reference image feature matrix into the first channel pooling submodule, and sequentially passing through the first channel pooling submodule, the first image encoding submodule and the first normalization submodule to obtain a third weight matrix;
[0212] The third weight matrix and the third initial reference image feature matrix are input into the first matrix dimension inverse transformation submodule to obtain the second reference image feature matrix.
[0213] In some embodiments, the second spatial attention branch includes a second matrix dimension transformation submodule, a second channel pooling submodule, a second image encoding submodule, a second normalization submodule, and a second matrix dimension inverse transformation submodule; the first input subunit is further used to:
[0214] Inputting the initial reference image feature matrix into the second matrix dimension transformation submodule for second dimension transformation processing to obtain a fourth initial reference image feature matrix;
[0215] Inputting the fourth initial reference image feature matrix into the second channel pooling submodule, and sequentially passing through the second channel pooling submodule, the second image encoding submodule and the second normalization submodule to obtain a fourth weight matrix;
[0216] The fourth weight matrix and the fourth initial reference image feature matrix are input into the second matrix dimension inverse transformation submodule to determine the third reference image feature matrix.
[0217] In some embodiments, the ShuffleNetV2 network further includes a Mosaic module, a Convolution-Batch Normalization-Activation Function CBS module and a Maximum Pooling module, and the first feature extraction submodule further includes:
[0218] A data enhancement unit, configured to perform data enhancement processing on the first image using the Mosaic module to obtain a second image;
[0219] a feature extraction unit, configured to input the second image into the CBS module to obtain an image feature matrix corresponding to the second image;
[0220] A sampling processing unit is used to use the maximum pooling module to downsample the image feature matrix corresponding to the second image to obtain an initial image feature matrix corresponding to the first image.
[0221] In some embodiments, the vehicle air conditioning parameter determination device 40 further includes:
[0222] A second acquisition module is used to acquire an image training set, wherein the image training set includes a plurality of image samples and a sample attribute category corresponding to each image sample, and a sample clothing category;
[0223] A first target detection module is used to input the multiple image samples into an initial YOLOv5s target detection model to obtain reference attribute categories and reference clothing categories corresponding to each image sample;
[0224] The first training module is used to perform back propagation training on the initial YOLOv5s target detection model based on the difference between the reference attribute category and the corresponding sample attribute category, and the difference between the reference clothing category and the sample clothing category, until the convergence condition is met, so as to obtain a trained YOLOv5s target detection model.
[0225] In some embodiments, the vehicle air conditioning parameter determination device 40 further includes:
[0226] A third acquisition module is used to acquire the user's attribute category samples, clothing category samples, temperature data samples, and feedback information of the user's preference for parameter settings of the air conditioner;
[0227] The second training module is used to train the initial air-conditioning parameter prediction model based on the category samples, clothing categories, temperature data samples and the feedback information to obtain the target air-conditioning parameter prediction model; the initial air-conditioning parameter prediction model is an untrained air-conditioning parameter prediction model.
[0228] It should be noted that the description of the vehicle air conditioning parameter determination device in the embodiment of the present application is similar to the description of the corresponding method embodiment above, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0229] It should be noted that in the embodiments of the present application, if the above-mentioned method for determining vehicle air conditioning parameters is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant solution. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0230] Accordingly, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for determining the vehicle air-conditioning parameters provided in the above embodiment is implemented.
[0231] An embodiment of the present application also provides a device for determining vehicle air-conditioning parameters. Figure 7 A schematic diagram of the structure of a vehicle air conditioning parameter determination device provided in an embodiment of the present application is as follows: Figure 7 As shown, the vehicle air conditioning parameter determination device 50 includes: a memory 51, a processor 52, a communication interface 53 and a communication bus 54. The memory 51 is used to store an executable vehicle air conditioning parameter determination instruction; the processor 52 is used to execute the executable vehicle air conditioning parameter determination instruction stored in the memory 51 to implement the vehicle air conditioning parameter determination method provided in the above embodiment.
[0232] The description of the above vehicle air conditioning parameter determination device and storage medium embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the vehicle air conditioning parameter determination device and storage medium embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0233] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes at least one ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0234] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0235] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0236] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, disks or optical disks.
[0237] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a product to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0238] The above are only implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field can be easily thought of within the technical scope disclosed in the present application. Changes or substitutions should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for determining vehicle air conditioning parameters, characterized in that: include: Acquire a first image of an occupant in a vehicle and temperature data collected by a vehicle sensor; Inputting the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network to obtain attribute category information and clothing category information of the occupant in the vehicle; the ShuffleNetV2 network is used to extract features from the first image; The attribute category information, the clothing category information and the temperature data are input into a target air-conditioning parameter prediction model to obtain target setting parameters of the air-conditioning, so as to adjust current parameters of the air-conditioning based on the target setting parameters.
2. The method according to claim 1, characterized in that The YOLOv5s target detection model also includes a category prediction module; The step of inputting the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network to obtain attribute category information and clothing category information of the occupant in the vehicle includes: Using the ShuffleNetV2 network to extract features from the first image, obtaining feature information of the target image; The target image feature information is input into the category prediction model to obtain the attribute category information and clothing category information of the occupant in the vehicle.
3. According to the method of claim 2, the ShuffleNetV2 network includes three super-marking attention mechanism STA modules and three Stage modules, the STA modules and the Stage modules are alternately connected, and the first STA module is connected after the first Stage module; The step of extracting features from the first image using the ShuffleNetV2 network to obtain target image feature information includes: Inputting an initial image feature matrix corresponding to the first image into the first Stage module, passing through the first STA module, and outputting a first image feature matrix from the first STA module; the initial image feature matrix is a feature matrix obtained after preprocessing the first image; Input the first image feature matrix into a second Stage module, pass through the second STA module, and output a second image feature matrix from the second STA module; inputting the second image feature matrix into a third Stage module, passing through the third STA module, and outputting a third image feature matrix from the third STA module; the scale parameters of the first image feature matrix, the second image feature matrix, and the third image feature matrix are all different; The target image feature information is determined based on the first image feature matrix, the second image feature matrix, and the third image feature matrix.
4. The method according to claim 3, characterized in that Each STA module includes a channel attention branch, a first spatial attention branch, and a second spatial attention branch; The processing process of each STA module includes: Obtaining an initial reference image feature matrix output by a Stage module before the STA module; Inputting the initial reference image feature matrix into the channel attention branch to obtain a first reference image feature matrix; inputting the initial reference image feature matrix into the first spatial attention branch to obtain a second reference image feature matrix; and inputting the initial reference image feature matrix into the second spatial attention branch to obtain a third reference image feature matrix; Based on the first reference image feature matrix, the second reference image feature matrix and the third reference image feature matrix, a target reference image feature matrix is obtained; the target reference image feature matrix is any one of the first image feature matrix, the second image feature matrix and the third image feature matrix.
5. The method according to claim 4, characterized in that The channel attention branch includes a channel segmentation module, a first sub-channel attention branch, a second sub-channel attention branch, and a matrix fusion module; the first sub-channel attention branch includes an average pooling sub-module and a first weight determination sub-module; the second sub-channel attention branch includes a maximum pooling sub-module and a second weight determination sub-module; The step of inputting the reference image feature matrix into the channel attention branch to obtain a first reference image feature matrix comprises: Inputting the initial reference image feature matrix into the channel segmentation module for channel segmentation processing to obtain a first initial reference image feature matrix and a second initial reference image feature matrix of the same dimension; Inputting the first initial reference image feature matrix into the average pooling submodule, and passing through the average pooling submodule and the first weight determination submodule to obtain a first weight vector corresponding to the first initial reference image feature matrix; and inputting the second initial reference image feature matrix into the maximum pooling submodule, and passing through the maximum pooling submodule and the second weight determination submodule to obtain a second weight vector corresponding to the second initial reference image matrix; The first weight vector, the first initial reference image feature matrix, the second weight vector and the second initial reference image feature matrix are input into the matrix fusion module to obtain the first reference image feature matrix.
6. The method according to claim 4, characterized in that The first spatial attention branch includes a first matrix dimension transformation submodule, a first channel pooling submodule, a first image encoding submodule, a first normalization submodule, and a first matrix dimension inverse transformation submodule; the initial reference image feature matrix is input into the first spatial attention branch to obtain a second reference image feature matrix, including: Inputting the initial reference image feature matrix into the first matrix dimension transformation module for first dimension transformation processing to obtain a third initial reference image feature matrix; Inputting the third initial reference image feature matrix into the first channel pooling submodule, and sequentially passing through the first channel pooling submodule, the first image encoding submodule and the first normalization submodule to obtain a third weight matrix; The third weight matrix and the third initial reference image feature matrix are input into the first matrix dimension inverse transformation submodule to obtain the second reference image feature matrix.
7. The method according to claim 4, characterized in that The second spatial attention branch includes a second matrix dimension transformation submodule, a second channel pooling submodule, a second image encoding submodule, a second normalization submodule, and a second matrix dimension inverse transformation submodule; The step of inputting the initial reference image feature matrix into the second spatial attention branch to obtain a third reference image feature matrix comprises: Inputting the initial reference image feature matrix into the second matrix dimension transformation submodule for second dimension transformation processing to obtain a fourth initial reference image feature matrix; Inputting the fourth initial reference image feature matrix into the second channel pooling submodule, and sequentially passing through the second channel pooling submodule, the second image encoding submodule and the second normalization submodule to obtain a fourth weight matrix; The fourth weight matrix and the fourth initial reference image feature matrix are input into the second matrix dimension inverse transformation submodule to determine the third reference image feature matrix.
8. The method according to claim 3, characterized in that The ShuffleNetV2 network also includes a Mosaic module, a convolution-batch normalization-activation function CBS module and a maximum pooling module. The method for preprocessing the first image includes: Using the Mosaic module to perform data enhancement processing on the first image to obtain a second image; Inputting the second image into the CBS module to obtain an image feature matrix corresponding to the second image; The maximum pooling module is used to downsample the image feature matrix corresponding to the second image to obtain an initial image feature matrix corresponding to the first image.
9. According to the method of claim 1, the training process of the YOLOv5s target detection model comprises: Acquire an image training set, wherein the image training set includes a plurality of image samples and a sample attribute category corresponding to each image sample, and a sample clothing category; Input the multiple image samples into the initial YOLOv5s target detection model to obtain reference attribute categories and reference clothing categories corresponding to each image sample; Based on the difference between the reference attribute category and the corresponding sample attribute category, and the difference between the reference clothing category and the sample clothing category, the initial YOLOv5s target detection model is back-propagated and trained until a convergence condition is met, thereby obtaining a trained YOLOv5s target detection model.
10. The method according to claim 1, characterized in that The method further comprises: Acquire a user's attribute category samples, clothing category samples, temperature data samples, and feedback information of the user's preference for parameter settings of the air conditioner; Based on the category samples, clothing categories, temperature data samples and the feedback information, an initial air-conditioning parameter prediction model is trained to obtain the target air-conditioning parameter prediction model; the initial air-conditioning parameter prediction model is an untrained air-conditioning parameter prediction model.
11. A device for determining vehicle air conditioning parameters, characterized in that: include: A first acquisition module, used to acquire a first image of an occupant in the vehicle and temperature data collected by a vehicle sensor; A first information determination module is used to input the first image into a YOLOv5s target detection model whose backbone network is a ShuffleNetV2 network, to obtain attribute category information and clothing category information of the occupant in the vehicle; the ShuffleNetV2 network is used to perform feature extraction on the first image; The first parameter determination module is used to input the attribute category information, the clothing category information and the temperature data into a target air conditioning parameter prediction model to obtain the target setting parameters of the air conditioner so as to adjust the current parameters of the air conditioner based on the target setting parameters.
12. A device for determining vehicle air conditioning parameters, characterized in that: include: processor and memory; wherein, The memory is used to store a computer program that can be run on the processor; The processor is configured to execute the method according to any one of claims 1 to 10 when running the computer program.
13. A computer-readable storage medium, characterized in that: The storage medium stores computer program code, and when the computer program code is executed by a computer, the method according to any one of claims 1 to 10 is executed.
Citation Information
Cited By
Control method and device of refrigeration equipment and refrigeration equipment
CN120488450A