Systems for recognizing human activities are being developed as part of a larger framework that will allow for continuous monitoring of human behavior in intelligent home environments for elderly care, ambient assisted living, rehabilitation, sports injury detection, surveillance, and entertainment. The most challenging component of the sensor-based human activity detection pipeline for mobile and wearable devices is extracting relevant features. Using mobile and wearable sensors, the most challenging step in the pipeline for recognizing the behaviors of humans is extracting relevant features. The algorithm's performance is affected by feature extraction, which also reduces computation complexity and time. However, existing methods of recognizing human activity rely on hand-crafted characteristics that cannot handle complicated behaviors. There are several known systems for recognizing individual activities, including deep learning, but more must be developed to recognize transitions between actions. To solve these challenges, a new deep learning-based system is proposed for recognizing human actions in this research. Initially, a fuzzy logic-based genetic algorithm (FGA) is used for extracting features from sensor data. The introduced feature selection approach, called PSOACO, aims to enhance the particle swarm optimizer (PSO) algorithm's performance through the ant colony optimizer (ACO) operators. Then, the deep learning approach, named Deep Convolutional Neural Network and Long Short Term Memory (DCNN-LSTM), is used to classify the activities. F1 Score, Recall, Precision, and Accuracy are used to analyze the implementation's effectiveness. The overall recognition accuracy of the proposed model for UCI-HAR, PAMAP2, and WISDM datasets is 99.92%, 99.86%, and 99.94 %. According to the implementation, the HAR with privacy performs better than existing methods done on the Python platform.