In bit-patterned media recording (BPMR), the magnetic islands are adjusted closer together to increase the areal density (AD). This makes the bit-error rate (BER) performance of BPMR worse by inter-symbol interference (ISI) and inter-track interference (ITI) from cross- and down-track directions, respectively. To solve the ISI and ITI issues, the data is modulated into non-isolated patterns before storing on the medium of BPMR systems. Furthermore, for improving the non-isolated patterned modulation code, we introduced a method to create the non-isolated patterned code with a minimum Hamming distance (MHD) of 3 instead of 2 as in the previous studies. In our proposed method, first, we considered the generator matrix (GM) of the Hamming code to create 1-D codewords with an MHD of 3. Furthermore, these codewords were converted into 2-D codewords, mitigating the isolated pattern. Finally, to create a fast encoder and decoder, we used the multi-layer perceptron (MLP) to encode the original data into the non-isolated codewords with an MHD of 3. The results show that our proposed model improved the BER performance of the BPMR system.